tdf#148087 assert editing a cell with OnSelectionChange macro breakpoint

assert was introduced in
    commit e1972743d692c8d8611912c31aae2cb08ae7636d
    Author: Noel Grandin <noelgrandin@gmail.com>
    Date:   Sun Sep 5 15:01:44 2021 +0200
    be more disciplined with SetUpdateLayout on editengine

We want to restore UpdateLayout when we're done doing layout, we should
not just leave it FALSE

Change-Id: Ic0431ffc3c66d0d02bfd10c323b18383f52dbc95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132209
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 8c37312..87ddc0b 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1739,8 +1739,11 @@ bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent )
    nTravelXPos         = TRAVEL_X_DONTKNOW;
    nExtraCursorFlags   = GetCursorFlags::NONE;
    nCursorBidiLevel    = CURSOR_BIDILEVEL_DONTKNOW;
    bool bPrevUpdateLayout = pEditEngine->pImpEditEngine->SetUpdateLayout(true);
    bClickedInSelection = IsSelectionAtPoint( rMouseEvent.GetPosPixel() );
    return pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, GetEditViewPtr() );
    bool bRet = pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, GetEditViewPtr() );
    pEditEngine->pImpEditEngine->SetUpdateLayout(bPrevUpdateLayout);
    return bRet;
}

bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent )
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a1b7afa..3cd4c3c 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3133,6 +3133,8 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL
    }

    std::vector<editeng::MisspellRanges> aMisspellRanges;
    // UpdateLayout must be true during CompleteOnlineSpelling
    const bool bUpdateLayout = mpEditEngine->SetUpdateLayout( true );
    mpEditEngine->CompleteOnlineSpelling();
    bool bSpellErrors = !bFormulaMode && mpEditEngine->HasOnlineSpellErrors();
    if ( bSpellErrors )
@@ -3399,6 +3401,8 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL

    bInOwnChange = false;
    bInEnterHandler = false;
    if (bUpdateLayout)
        mpEditEngine->SetUpdateLayout( true );
}

void ScInputHandler::CancelHandler()