editeng/source/editeng/impedit2.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 8d97770bbab4b6c12bda84b545d216f813f1e885 Author: Noel Grandin <[email protected]> AuthorDate: Fri Oct 3 11:09:59 2025 +0200 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Thu Feb 5 11:12:09 2026 +0100 tdf#168674 Assertion fires when editing a formula in formula bar in debug on Windows, this assert fires because we have a stack like: editenglo.dll!ImpEditEngine::PaMtoEditCursor editenglo.dll!ImpEditEngine::Command .... sclo.dll!ScTabView::ActiveGrabFocus sclo.dll!ScInputHandler::EnterHandler2 where EnterHandler2 is disabling layout, but during the focus grab, on Windows, some SalInputContext code is triggered, which then needs the layout. Change-Id: I14b213af57a8e78f3983f0fd96110888906b43d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191814 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> (cherry picked from commit f6c809b021312dbda2964aa98beebb872bdbd81a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198704 Reviewed-by: Michael Weghorn <[email protected]> diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d4ac8c4b7f77..0a14a827efdc 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -491,7 +491,10 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) } else if ( rCEvt.GetCommand() == CommandEventId::CursorPos ) { - EditPaM aPaM( pView->getImpl().GetEditSelection().Max() ); + // tdf#168674 we are possibly being called from the calc formula bar in ScInputHandler::EnterHandler2, where layout is off + const bool bOldUpdateLayout = SetUpdateLayout(true); + + EditPaM aPaM(pView->getImpl().GetEditSelection().Max()); tools::Rectangle aR1 = PaMtoEditCursor( aPaM ); if ( !IsFormatted() ) @@ -519,6 +522,7 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) else if (vcl::Window* pWindow = pView->GetWindow()) pWindow->SetCursorRect(&aRect, nExtTextInputWidth); } + SetUpdateLayout(bOldUpdateLayout); } else if ( rCEvt.GetCommand() == CommandEventId::SelectionChange ) {
