chart2/source/controller/main/ChartController_TextEdit.cxx | 4 - editeng/source/editeng/editdbg.cxx | 2 editeng/source/editeng/editeng.cxx | 49 ++++++------- editeng/source/editeng/editundo.cxx | 4 - editeng/source/editeng/editview.cxx | 28 +++---- editeng/source/editeng/impedit.cxx | 14 +-- editeng/source/editeng/impedit.hxx | 11 +- editeng/source/editeng/impedit2.cxx | 20 ++--- editeng/source/editeng/impedit3.cxx | 34 ++++----- editeng/source/editeng/impedit4.cxx | 21 ++--- editeng/source/editeng/impedit5.cxx | 11 +- editeng/source/outliner/outlin2.cxx | 8 +- editeng/source/outliner/outliner.cxx | 44 ++++------- editeng/source/outliner/outlvw.cxx | 43 ++++------- editeng/source/uno/unofored.cxx | 2 editeng/source/uno/unoforou.cxx | 2 filter/source/msfilter/msdffimp.cxx | 10 +- filter/source/msfilter/svdfppt.cxx | 5 - forms/source/richtext/richtextunowrapper.cxx | 2 forms/source/richtext/richtextvclcontrol.cxx | 6 - include/editeng/editeng.hxx | 7 + include/editeng/editview.hxx | 5 - include/editeng/outliner.hxx | 5 - sc/source/core/data/column2.cxx | 4 - sc/source/core/data/documen2.cxx | 7 - sc/source/core/data/stlpool.cxx | 2 sc/source/core/tool/editutil.cxx | 48 ++++-------- sc/source/filter/excel/xehelper.cxx | 20 ++--- sc/source/filter/excel/xlroot.cxx | 6 - sc/source/filter/html/htmlexp.cxx | 5 - sc/source/filter/oox/workbookhelper.cxx | 2 sc/source/filter/rtf/eeimpars.cxx | 2 sc/source/filter/xml/xmlimprt.cxx | 2 sc/source/ui/Accessibility/AccessibleDocument.cxx | 2 sc/source/ui/app/inputhdl.cxx | 24 +++--- sc/source/ui/app/inputwin.cxx | 14 +-- sc/source/ui/docshell/docfunc.cxx | 6 - sc/source/ui/drawfunc/drtxtob.cxx | 6 - sc/source/ui/view/editsh.cxx | 10 +- sc/source/ui/view/output2.cxx | 30 +++---- sc/source/ui/view/viewdata.cxx | 2 sd/source/core/drawdoc.cxx | 4 - sd/source/core/drawdoc4.cxx | 4 - sd/source/core/sdpage.cxx | 7 - sd/source/filter/html/htmlex.cxx | 5 - sd/source/ui/annotations/annotationmanager.cxx | 2 sd/source/ui/annotations/annotationwindow.cxx | 2 sd/source/ui/func/fubullet.cxx | 8 +- sd/source/ui/func/fuexpand.cxx | 2 sd/source/ui/func/fusumry.cxx | 2 sd/source/ui/view/DocumentRenderer.cxx | 12 +-- sd/source/ui/view/Outliner.cxx | 16 ++-- sd/source/ui/view/drawview.cxx | 4 - sd/source/ui/view/drviews2.cxx | 8 +- sd/source/ui/view/drviewse.cxx | 4 - sd/source/ui/view/outlnvsh.cxx | 2 sd/source/ui/view/outlview.cxx | 8 +- sd/source/ui/view/sdview2.cxx | 6 - starmath/source/smediteng.cxx | 2 svx/source/dialog/weldeditview.cxx | 4 - svx/source/svdraw/svdedxv.cxx | 10 +- svx/source/svdraw/svdmodel.cxx | 2 svx/source/svdraw/svdoashp.cxx | 6 - svx/source/svdraw/svdomeas.cxx | 2 svx/source/svdraw/svdotext.cxx | 12 +-- svx/source/svdraw/svdotextdecomposition.cxx | 14 +-- svx/source/svdraw/svdotextpathdecomposition.cxx | 2 svx/source/svdraw/svdotxat.cxx | 2 svx/source/svdraw/svdotxed.cxx | 5 - svx/source/svdraw/svdoutl.cxx | 2 svx/source/svdraw/textchainflow.cxx | 6 - svx/source/table/cell.cxx | 6 - svx/source/table/svdotable.cxx | 9 +- svx/source/table/tablertfimporter.cxx | 4 - svx/source/unodraw/unoshtxt.cxx | 6 - sw/source/filter/html/htmldrawwriter.cxx | 2 sw/source/uibase/docvw/AnnotationWin2.cxx | 2 sw/source/uibase/lingu/sdrhhcwrap.cxx | 10 +- sw/source/uibase/shells/annotsh.cxx | 4 - sw/source/uibase/shells/drwtxtsh.cxx | 4 - 80 files changed, 345 insertions(+), 396 deletions(-)
New commits: commit c1c679deca078209bc3008ccd9ccc0a8715929a1 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed Sep 1 18:26:29 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Sep 2 19:08:49 2021 +0200 rename UpdateMode -> UpdateLayout in editeng class ... because "update" is such a generic term I keep forgetting what we are turning on and off Also return the previous value from SetUpdateLayout to make the save/restore code more compact. Change-Id: Iae1764c837a92e58c9b17521f130e8fc80311d22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121479 Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index 217accdde083..23b590907f67 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -193,7 +193,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter() // prevent flicker pOutlinerView->HideCursor(); - pOutliner->SetUpdateMode(false); + pOutliner->SetUpdateLayout(false); // delete current selection by inserting empty String, so current // attributes become unique (sel. has to be erased anyway) @@ -207,7 +207,7 @@ void ChartController::executeDispatch_InsertSpecialCharacter() pOutlinerView->SetSelection(aSel); // show changes - pOutliner->SetUpdateMode(true); + pOutliner->SetUpdateLayout(true); pOutlinerView->ShowCursor(); } diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index d2a97cdb0efa..89bff9f34fc6 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -457,7 +457,7 @@ void EditEngine::DumpData(const EditEngine* pEE, bool bInfoBox) fprintf( fp, "\nPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetPaperSize().Width()), sal_Int64(pEE->GetPaperSize().Height()) ); fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64, sal_Int64(pEE->GetMaxAutoPaperSize().Width()), sal_Int64(pEE->GetMaxAutoPaperSize().Height()) ); fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT64 " x %" SAL_PRIdINT64 , sal_Int64(pEE->GetMinAutoPaperSize().Width()), sal_Int64(pEE->GetMinAutoPaperSize().Height()) ); - fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() ); + fprintf( fp, "\nCalculateLayout: %i", pEE->IsUpdateLayout() ); fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() ); for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ ) { diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index fff07dfdc836..b5b3c543354a 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -412,7 +412,7 @@ void EditEngine::SetPaperSize( const Size& rNewSize ) pImpEditEngine->UpdateViews( pImpEditEngine->GetActiveView() ); - if ( pImpEditEngine->GetUpdateMode() && pImpEditEngine->GetActiveView() ) + if ( pImpEditEngine->IsUpdateLayout() && pImpEditEngine->GetActiveView() ) pImpEditEngine->pActiveView->ShowCursor( false, false ); } } @@ -795,9 +795,9 @@ void EditEngine::SetUndoMode(bool b) pImpEditEngine->SetUndoMode(b); } -void EditEngine::FormatAndUpdate(EditView* pCurView, bool bCalledFromUndo) +void EditEngine::FormatAndLayout(EditView* pCurView, bool bCalledFromUndo) { - pImpEditEngine->FormatAndUpdate(pCurView, bCalledFromUndo); + pImpEditEngine->FormatAndLayout(pCurView, bCalledFromUndo); } void EditEngine::Undo(EditView* pView) @@ -1177,7 +1177,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v // (not painting a numbering in the list may cause the following // numberings to have different numbers than before and thus the // length may have changed as well ) - pImpEditEngine->FormatAndUpdate( pImpEditEngine->GetActiveView() ); + pImpEditEngine->FormatAndLayout( pImpEditEngine->GetActiveView() ); break; } @@ -1421,9 +1421,9 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v // Idle-Formatter only when AnyInput. if ( bAllowIdle && pImpEditEngine->GetStatus().UseIdleFormatter() && Application::AnyInput( VclInputFlags::KEYBOARD) ) - pImpEditEngine->IdleFormatAndUpdate( pEditView ); + pImpEditEngine->IdleFormatAndLayout( pEditView ); else - pImpEditEngine->FormatAndUpdate( pEditView ); + pImpEditEngine->FormatAndLayout( pEditView ); } else if ( bMoved ) { @@ -1467,19 +1467,20 @@ sal_uInt32 EditEngine::CalcTextWidth() return nWidth; } -void EditEngine::SetUpdateMode(bool bUpdate, bool bRestoring) +bool EditEngine::SetUpdateLayout(bool bUpdate, bool bRestoring) { - pImpEditEngine->SetUpdateMode( bUpdate ); + bool bPrevUpdateLayout = pImpEditEngine->SetUpdateLayout( bUpdate ); if (pImpEditEngine->pActiveView) { // Not an activation if we are restoring the previous update mode. pImpEditEngine->pActiveView->ShowCursor(false, false, /*bActivate=*/!bRestoring); } + return bPrevUpdateLayout; } -bool EditEngine::GetUpdateMode() const +bool EditEngine::IsUpdateLayout() const { - return pImpEditEngine->GetUpdateMode(); + return pImpEditEngine->IsUpdateLayout(); } void EditEngine::Clear() @@ -1490,8 +1491,8 @@ void EditEngine::Clear() void EditEngine::SetText( const OUString& rText ) { pImpEditEngine->SetText( rText ); - if ( !rText.isEmpty() && pImpEditEngine->GetUpdateMode() ) - pImpEditEngine->FormatAndUpdate(); + if ( !rText.isEmpty() && pImpEditEngine->IsUpdateLayout() ) + pImpEditEngine->FormatAndLayout(); } ErrCode EditEngine::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs /* = NULL */ ) @@ -1532,7 +1533,7 @@ std::unique_ptr<EditTextObject> EditEngine::GetEmptyTextObject() const void EditEngine::SetText( const EditTextObject& rTextObject ) { pImpEditEngine->SetText( rTextObject ); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } void EditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) @@ -1636,7 +1637,7 @@ void EditEngine::RemoveParagraph( sal_Int32 nPara ) pImpEditEngine->ImpRemoveParagraph( nPara ); pImpEditEngine->InvalidateFromParagraph( nPara ); pImpEditEngine->UpdateSelections(); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } } @@ -1711,7 +1712,7 @@ void EditEngine::InsertParagraph( sal_Int32 nPara, const EditTextObject& rTxtObj pImpEditEngine->UndoActionEnd(); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } void EditEngine::InsertParagraph(sal_Int32 nPara, const OUString& rTxt) @@ -1729,7 +1730,7 @@ void EditEngine::InsertParagraph(sal_Int32 nPara, const OUString& rTxt) pImpEditEngine->RemoveCharAttribs( nPara ); pImpEditEngine->UndoActionEnd(); pImpEditEngine->ImpInsertText( EditSelection( aPaM, aPaM ), rTxt ); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } void EditEngine::SetText(sal_Int32 nPara, const OUString& rTxt) @@ -1740,15 +1741,15 @@ void EditEngine::SetText(sal_Int32 nPara, const OUString& rTxt) pImpEditEngine->UndoActionStart( EDITUNDO_INSERT ); pImpEditEngine->ImpInsertText( *pSel, rTxt ); pImpEditEngine->UndoActionEnd(); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } } void EditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) { pImpEditEngine->SetParaAttribs( nPara, rSet ); - if ( pImpEditEngine->GetUpdateMode() ) - pImpEditEngine->FormatAndUpdate(); + if ( pImpEditEngine->IsUpdateLayout() ) + pImpEditEngine->FormatAndLayout(); } const SfxItemSet& EditEngine::GetParaAttribs( sal_Int32 nPara ) const @@ -1772,7 +1773,7 @@ void EditEngine::SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet) // This is called by sd::View::OnBeginPasteOrDrop(), updating the cursor position on undo is not // wanted. pImpEditEngine->SetAttribs(aSel, rSet, /*nSpecial=*/SetAttribsMode::NONE, /*bSetSelection=*/false); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } void EditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const @@ -1802,7 +1803,7 @@ void EditEngine::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAt EditSelection aSel( pImpEditEngine->ConvertSelection( rSelection.nStartPara, rSelection.nStartPos, rSelection.nEndPara, rSelection.nEndPos ) ); pImpEditEngine->RemoveCharAttribs( aSel, eMode, nWhich ); pImpEditEngine->UndoActionEnd(); - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); } vcl::Font EditEngine::GetStandardFont( sal_Int32 nPara ) @@ -1988,7 +1989,7 @@ Point EditEngine::GetDocPosTopLeft( sal_Int32 nParagraph ) // If someone calls GetLineHeight() with an empty Engine. DBG_ASSERT( pImpEditEngine->IsFormatted() || !pImpEditEngine->IsFormatting(), "GetDocPosTopLeft: Doc not formatted - unable to format!" ); if ( !pImpEditEngine->IsFormatted() ) - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); if ( pPPortion->GetLines().Count() ) { // Correct it if large Bullet. @@ -2327,7 +2328,7 @@ bool EditEngine::UpdateFields() { bool bChanges = pImpEditEngine->UpdateFields(); if ( bChanges ) - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); return bChanges; } @@ -2380,7 +2381,7 @@ void EditEngine::CompleteOnlineSpelling() if ( pImpEditEngine->GetStatus().DoOnlineSpelling() ) { if( !pImpEditEngine->IsFormatted() ) - pImpEditEngine->FormatAndUpdate(); + pImpEditEngine->FormatAndLayout(); pImpEditEngine->StopOnlineSpellTimer(); pImpEditEngine->DoOnlineSpelling( nullptr, true, false ); diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 892183f754af..8df80a629a1d 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -75,7 +75,7 @@ bool EditUndoManager::Undo() aNewSel.Min() = aNewSel.Max(); mpEditEngine->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); - mpEditEngine->FormatAndUpdate( mpEditEngine->GetActiveView(), true ); + mpEditEngine->FormatAndLayout( mpEditEngine->GetActiveView(), true ); return bDone; } @@ -110,7 +110,7 @@ bool EditUndoManager::Redo() aNewSel.Min() = aNewSel.Max(); mpEditEngine->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); - mpEditEngine->FormatAndUpdate( mpEditEngine->GetActiveView() ); + mpEditEngine->FormatAndLayout( mpEditEngine->GetActiveView() ); return bDone; } diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 1d4ebfae186c..59969fca90cb 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -454,7 +454,7 @@ void EditView::InsertText( const OUString& rStr, bool bSelect, bool bLOKShowSele pImpEditView->SetEditSelection( EditSelection( aPaM2, aPaM2 ) ); if (bLOKShowSelect) - pEE->FormatAndUpdate( this ); + pEE->FormatAndLayout( this ); } bool EditView::PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const * pFrameWin ) @@ -555,7 +555,7 @@ void EditView::SetAttribs( const SfxItemSet& rSet ) pImpEditView->DrawSelectionXOR(); pImpEditView->pEditEngine->SetAttribs( pImpEditView->GetEditSelection(), rSet, SetAttribsMode::WholeWord ); - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } void EditView::RemoveAttribsKeepLanguages( bool bRemoveParaAttribs ) @@ -575,7 +575,7 @@ void EditView::RemoveAttribsKeepLanguages( bool bRemoveParaAttribs ) } pImpEditView->pEditEngine->UndoActionEnd(); - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } void EditView::RemoveAttribs( bool bRemoveParaAttribs, sal_uInt16 nWhich ) @@ -590,7 +590,7 @@ void EditView::RemoveAttribs( EERemoveParaAttribsMode eMode, sal_uInt16 nWhich ) pImpEditView->pEditEngine->UndoActionStart( EDITUNDO_RESETATTRIBS ); pImpEditView->pEditEngine->RemoveCharAttribs( pImpEditView->GetEditSelection(), eMode, nWhich ); pImpEditView->pEditEngine->UndoActionEnd(); - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } void EditView::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich ) @@ -598,7 +598,7 @@ void EditView::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich ) pImpEditView->pEditEngine->UndoActionStart( EDITUNDO_RESETATTRIBS ); pImpEditView->pEditEngine->RemoveCharAttribs( nPara, nWhich ); pImpEditView->pEditEngine->UndoActionEnd(); - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } SfxItemSet EditView::GetAttribs() @@ -749,7 +749,7 @@ void EditView::InsertText( const EditTextObject& rTextObject ) aTextSel.Min() = aTextSel.Max(); // Selection not retained. pImpEditView->SetEditSelection( aTextSel ); - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } void EditView::InsertText( css::uno::Reference< css::datatransfer::XTransferable > const & xDataObj, const OUString& rBaseURL, bool bUseSpecial ) @@ -762,17 +762,17 @@ void EditView::InsertText( css::uno::Reference< css::datatransfer::XTransferable aTextSel.Min() = aTextSel.Max(); // Selection not retained. pImpEditView->SetEditSelection( aTextSel ); - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } -void EditView::SetEditEngineUpdateMode( bool bUpdate ) +bool EditView::SetEditEngineUpdateLayout( bool bUpdate ) { - pImpEditView->pEditEngine->pImpEditEngine->SetUpdateMode( bUpdate, this ); + return pImpEditView->pEditEngine->pImpEditEngine->SetUpdateLayout( bUpdate, this ); } -void EditView::ForceUpdate() +void EditView::ForceLayoutCalculation() { - pImpEditView->pEditEngine->pImpEditEngine->SetUpdateMode( true, this, true ); + pImpEditView->pEditEngine->pImpEditEngine->SetUpdateLayout( true, this, true ); } SfxStyleSheet* EditView::GetStyleSheet() @@ -840,7 +840,7 @@ void EditView::CompleteAutoCorrect( vcl::Window const * pFrameWin ) aSel = pImpEditView->pEditEngine->pImpEditEngine->AutoCorrect( aSel, 0, !IsInsertMode(), pFrameWin ); pImpEditView->SetEditSelection( aSel ); if ( pImpEditView->pEditEngine->IsModified() ) - pImpEditView->pEditEngine->FormatAndUpdate( this ); + pImpEditView->pEditEngine->FormatAndLayout( this ); } } @@ -1285,7 +1285,7 @@ void EditView::InsertParaBreak() EditPaM aPaM(pImpEditView->pEditEngine->InsertParaBreak(pImpEditView->GetEditSelection())); pImpEditView->pEditEngine->UndoActionEnd(); pImpEditView->SetEditSelection(EditSelection(aPaM, aPaM)); - pImpEditView->pEditEngine->FormatAndUpdate(this); + pImpEditView->pEditEngine->FormatAndLayout(this); } void EditView::InsertField( const SvxFieldItem& rFld ) @@ -1297,7 +1297,7 @@ void EditView::InsertField( const SvxFieldItem& rFld ) pEE->UndoActionEnd(); pImpEditView->SetEditSelection( EditSelection( aPaM, aPaM ) ); pEE->UpdateFields(); - pEE->FormatAndUpdate( this ); + pEE->FormatAndLayout( this ); } const SvxFieldItem* EditView::GetFieldUnderMousePointer() const diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 27d3f979655e..19bd96ccde71 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -491,7 +491,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, if ( !pRegion && !comphelper::LibreOfficeKit::isActive()) { - if ( !pEditEngine->pImpEditEngine->GetUpdateMode() ) + if ( !pEditEngine->pImpEditEngine->IsUpdateLayout() ) return; if ( pEditEngine->pImpEditEngine->IsInUndo() ) return; @@ -893,7 +893,7 @@ void ImpEditView::ResetOutputArea( const tools::Rectangle& rRect ) SetOutputArea(rRect); // invalidate surrounding areas if update is true - if(aOldArea.IsEmpty() || !pEditEngine->pImpEditEngine->GetUpdateMode()) + if(aOldArea.IsEmpty() || !pEditEngine->pImpEditEngine->IsUpdateLayout()) return; // #i119885# use grown area if needed; do when getting bigger OR smaller @@ -1169,7 +1169,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) // is initialized in Paint, because no SetPool(); if ( pEditEngine->pImpEditEngine->IsFormatting() ) return; - if ( !pEditEngine->pImpEditEngine->GetUpdateMode() ) + if ( !pEditEngine->pImpEditEngine->IsUpdateLayout() ) return; if ( pEditEngine->pImpEditEngine->IsInUndo() ) return; @@ -1812,7 +1812,7 @@ void ImpEditView::DeleteSelected() DrawSelectionXOR(); - pEditEngine->pImpEditEngine->FormatAndUpdate( GetEditViewPtr() ); + pEditEngine->pImpEditEngine->FormatAndLayout( GetEditViewPtr() ); ShowCursor( DoAutoScroll(), true ); } @@ -1989,7 +1989,7 @@ void ImpEditView::Paste( css::uno::Reference< css::datatransfer::clipboard::XCli pEditEngine->pImpEditEngine->UndoActionEnd(); SetEditSelection( aSel ); pEditEngine->pImpEditEngine->UpdateSelections(); - pEditEngine->pImpEditEngine->FormatAndUpdate( GetEditViewPtr() ); + pEditEngine->pImpEditEngine->FormatAndLayout( GetEditViewPtr() ); ShowCursor( DoAutoScroll(), true ); } @@ -2344,7 +2344,7 @@ void ImpEditView::dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent DBG_ASSERT( !pEditEngine->pImpEditEngine->CreateSel( aNewSel ).DbgIsBuggy(pEditEngine->GetEditDoc()), "Bad" ); SetEditSelection( pEditEngine->pImpEditEngine->CreateSel( aNewSel ) ); } - pEditEngine->pImpEditEngine->FormatAndUpdate( pEditEngine->pImpEditEngine->GetActiveView() ); + pEditEngine->pImpEditEngine->FormatAndLayout( pEditEngine->pImpEditEngine->GetActiveView() ); DrawSelectionXOR(); } else @@ -2410,7 +2410,7 @@ void ImpEditView::drop( const css::datatransfer::dnd::DropTargetDropEvent& rDTDE pEditEngine->HandleEndPasteOrDrop(aPasteOrDropInfos); SetEditSelection( aNewSel ); - pEditEngine->pImpEditEngine->FormatAndUpdate( pEditEngine->pImpEditEngine->GetActiveView() ); + pEditEngine->pImpEditEngine->FormatAndLayout( pEditEngine->pImpEditEngine->GetActiveView() ); if ( pDragAndDropInfo->bStarterOfDD ) { // Only set if the same engine! diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 216506c98828..b3ca1e284671 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -590,7 +590,7 @@ private: bool bFormatted:1; bool bInSelection:1; bool bIsInUndo:1; - bool bUpdate:1; + bool bUpdateLayout:1; bool bUndoEnabled:1; bool bDowning:1; bool bUseAutoColor:1; @@ -787,7 +787,7 @@ private: tools::Long Calc1ColumnTextHeight(tools::Long* pHeightNTP); - void IdleFormatAndUpdate(EditView* pCurView) { aIdleFormatter.DoIdleFormat(pCurView); } + void IdleFormatAndLayout(EditView* pCurView) { aIdleFormatter.DoIdleFormat(pCurView); } protected: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; @@ -800,8 +800,9 @@ public: inline EditUndoManager& GetUndoManager(); inline SfxUndoManager* SetUndoManager(SfxUndoManager* pNew); - void SetUpdateMode( bool bUp, EditView* pCurView = nullptr, bool bForceUpdate = false ); - bool GetUpdateMode() const { return bUpdate; } + // @return the previous bUpdateLayout state + bool SetUpdateLayout( bool bUpdate, EditView* pCurView = nullptr, bool bForceUpdate = false ); + bool IsUpdateLayout() const { return bUpdateLayout; } ViewsType& GetEditViews() { return aEditViews; } const ViewsType& GetEditViews() const { return aEditViews; } @@ -954,7 +955,7 @@ public: void SetNotifyHdl( const Link<EENotify&,void>& rLink ) { aNotifyHdl = rLink; } const Link<EENotify&,void>& GetNotifyHdl() const { return aNotifyHdl; } - void FormatAndUpdate( EditView* pCurView = nullptr, bool bCalledFromUndo = false ); + void FormatAndLayout( EditView* pCurView = nullptr, bool bCalledFromUndo = false ); const svtools::ColorConfig& GetColorConfig() const { return maColorConfig; } bool IsVisualCursorTravelingEnabled(); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index f99ba4d0a32c..8173558a097f 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -111,7 +111,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : bFormatted(false), bInSelection(false), bIsInUndo(false), - bUpdate(true), + bUpdateLayout(true), bUndoEnabled(true), bDowning(false), bUseAutoColor(true), @@ -172,7 +172,7 @@ ImpEditEngine::~ImpEditEngine() // when a parent template is destroyed. // And this after the destruction of the data! bDowning = true; - SetUpdateMode( false ); + SetUpdateLayout( false ); Dispose(); // it's only legal to delete the pUndoManager if it was created by @@ -385,7 +385,7 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) mpIMEInfos.reset(); - FormatAndUpdate( pView ); + FormatAndLayout( pView ); pView->SetInsertMode( !bWasCursorOverwrite ); } @@ -446,7 +446,7 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) ParaPortion& rPortion = FindParaPortion( mpIMEInfos->aPos.GetNode() ); rPortion.MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex() ); - FormatAndUpdate( pView ); + FormatAndLayout( pView ); } EditSelection aNewSel = EditPaM( mpIMEInfos->aPos.GetNode(), mpIMEInfos->aPos.GetIndex()+pData->GetCursorPos() ); @@ -706,7 +706,7 @@ void ImpEditEngine::SetText(const OUString& rText) pView->pImpEditView->SetEditSelection( EditSelection( aPaM, aPaM ) ); // If no text then also no Format&Update // => The text remains. - if (rText.isEmpty() && GetUpdateMode()) + if (rText.isEmpty() && IsUpdateLayout()) { tools::Rectangle aTmpRect( pView->GetOutputArea().TopLeft(), Size( aPaperSize.Width(), nCurTextHeight ) ); @@ -3066,7 +3066,7 @@ tools::Rectangle ImpEditEngine::GetEditCursor(const ParaPortion* pPortion, const tools::Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, GetCursorFlags nFlags ) { - OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: PaMtoEditCursor" ); + OSL_ENSURE( IsUpdateLayout(), "Must not be reached when Update=FALSE: PaMtoEditCursor" ); tools::Rectangle aEditCursor; const sal_Int32 nIndex = aPaM.GetIndex(); @@ -3235,7 +3235,7 @@ ImpEditEngine::GetPortionAndLine(Point aDocPos) EditPaM ImpEditEngine::GetPaM( Point aDocPos, bool bSmart ) { - OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: GetPaM" ); + OSL_ENSURE( IsUpdateLayout(), "Must not be reached when Update=FALSE: GetPaM" ); if (const auto& [pPortion, pLine, nLineStartX] = GetPortionAndLine(aDocPos); pPortion) { @@ -3268,7 +3268,7 @@ bool ImpEditEngine::IsTextPos(const Point& rDocPos, sal_uInt16 nBorder) sal_uInt32 ImpEditEngine::GetTextHeight() const { - OSL_ENSURE( GetUpdateMode(), "Should not be used for Update=FALSE: GetTextHeight" ); + OSL_ENSURE( IsUpdateLayout(), "Should not be used for Update=FALSE: GetTextHeight" ); OSL_ENSURE( IsFormatted() || IsFormatting(), "GetTextHeight: Not formatted" ); return nCurTextHeight; } @@ -3402,7 +3402,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_uInt32 ImpEditEngine::GetTextHeightNTP() const { - DBG_ASSERT( GetUpdateMode(), "Should not be used for Update=FALSE: GetTextHeight" ); + DBG_ASSERT( IsUpdateLayout(), "Should not be used for Update=FALSE: GetTextHeight" ); DBG_ASSERT( IsFormatted() || IsFormatting(), "GetTextHeight: Not formatted" ); return nCurTextHeightNTP; } @@ -3432,7 +3432,7 @@ tools::Long ImpEditEngine::Calc1ColumnTextHeight(tools::Long* pHeightNTP) tools::Long ImpEditEngine::CalcTextHeight(tools::Long* pHeightNTP) { - OSL_ENSURE( GetUpdateMode(), "Should not be used when Update=FALSE: CalcTextHeight" ); + OSL_ENSURE( IsUpdateLayout(), "Should not be used when Update=FALSE: CalcTextHeight" ); if (mnColumns <= 1) return Calc1ColumnTextHeight(pHeightNTP); // All text fits into a single column - done! diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index e7e4445b4c6b..8a5d53675d5a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -278,7 +278,7 @@ static bool lcl_ConnectToPrev( sal_Unicode cCh, sal_Unicode cPrevCh ) // For Ka void ImpEditEngine::UpdateViews( EditView* pCurView ) { - if ( !GetUpdateMode() || IsFormatting() || aInvalidRect.IsEmpty() ) + if ( !IsUpdateLayout() || IsFormatting() || aInvalidRect.IsEmpty() ) return; DBG_ASSERT( IsFormatted(), "UpdateViews: Doc not formatted!" ); @@ -315,7 +315,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) IMPL_LINK_NOARG(ImpEditEngine, OnlineSpellHdl, Timer *, void) { - if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) && GetUpdateMode() && IsFormatted() ) + if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) && IsUpdateLayout() && IsFormatted() ) DoOnlineSpelling(); else aOnlineSpellTimer.Start(); @@ -333,7 +333,7 @@ IMPL_LINK_NOARG(ImpEditEngine, IdleFormatHdl, Timer *, void) { if( aEditView == pView ) { - FormatAndUpdate( pView ); + FormatAndLayout( pView ); break; } } @@ -362,7 +362,7 @@ void ImpEditEngine::FormatFullDoc() void ImpEditEngine::FormatDoc() { - if (!GetUpdateMode() || IsFormatting()) + if (!IsUpdateLayout() || IsFormatting()) return; bIsFormatting = true; @@ -2598,7 +2598,7 @@ void ImpEditEngine::SetTextRanger( std::unique_ptr<TextRanger> pRanger ) FormatFullDoc(); UpdateViews( GetActiveView() ); - if ( GetUpdateMode() && GetActiveView() ) + if ( IsUpdateLayout() && GetActiveView() ) pActiveView->ShowCursor(false, false); } @@ -3090,7 +3090,7 @@ Point ImpEditEngine::MoveToNextLine( void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly, Degree10 nOrientation ) { - if ( !GetUpdateMode() && !bStripOnly ) + if ( !IsUpdateLayout() && !bStripOnly ) return; if ( !IsFormatted() ) @@ -3835,7 +3835,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po void ImpEditEngine::Paint( ImpEditView* pView, const tools::Rectangle& rRect, OutputDevice* pTargetDevice ) { - if ( !GetUpdateMode() || IsInUndo() ) + if ( !IsUpdateLayout() || IsInUndo() ) return; assert( pView && "No View - No Paint!" ); @@ -3915,9 +3915,10 @@ EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, bool bBackward ) return ImpConnectParagraphs( pLeftNode, pRightNode, bBackward ); } -void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, bool bForceUpdate ) +bool ImpEditEngine::SetUpdateLayout( bool bUp, EditView* pCurView, bool bForceUpdate ) { - const bool bChanged = (GetUpdateMode() != bUp); + const bool bPrevUpdateLayout = bUpdateLayout; + const bool bChanged = (bUpdateLayout != bUp); // When switching from true to false, all selections were visible, // => paint over @@ -3925,9 +3926,10 @@ void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, bool bForceUpda // If !bFormatted, e.g. after SetText, then if UpdateMode=true // formatting is not needed immediately, probably because more text is coming. // At latest it is formatted at a Paint/CalcTextWidth. - bUpdate = bUp; - if ( bUpdate && ( bChanged || bForceUpdate ) ) - FormatAndUpdate( pCurView ); + bUpdateLayout = bUp; + if ( bUpdateLayout && ( bChanged || bForceUpdate ) ) + FormatAndLayout( pCurView ); + return bPrevUpdateLayout; } void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) @@ -3970,7 +3972,7 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) } pPPortion->SetMustRepaint( true ); - if ( GetUpdateMode() && !IsInUndo() && !GetTextRanger() ) + if ( IsUpdateLayout() && !IsInUndo() && !GetTextRanger() ) { aInvalidRect = tools::Rectangle( Point( 0, GetParaPortions().GetYOffset( pPPortion ) ), Point( GetPaperSize().Width(), nCurTextHeight ) ); @@ -3993,7 +3995,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew // Where the paragraph was inserted it has to be properly redrawn: // Where the paragraph was removed it has to be properly redrawn: // ( and correspondingly in between as well...) - if ( pCurView && GetUpdateMode() ) + if ( pCurView && IsUpdateLayout() ) { // in this case one can redraw directly without invalidating the // Portions @@ -4176,13 +4178,13 @@ std::unique_ptr<EditSelection> ImpEditEngine::SelectParagraph( sal_Int32 nPara ) return pSel; } -void ImpEditEngine::FormatAndUpdate( EditView* pCurView, bool bCalledFromUndo ) +void ImpEditEngine::FormatAndLayout( EditView* pCurView, bool bCalledFromUndo ) { if ( bDowning ) return ; if ( IsInUndo() ) - IdleFormatAndUpdate( pCurView ); + IdleFormatAndLayout( pCurView ); else { if (bCalledFromUndo) diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 4e3b1bf21d04..2336155b2dd7 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -85,8 +85,7 @@ using namespace ::com::sun::star::linguistic2; EditPaM ImpEditEngine::Read(SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, const EditSelection& rSel, SvKeyValueIterator* pHTTPHeaderAttrs) { - bool _bUpdate = GetUpdateMode(); - SetUpdateMode( false ); + bool _bUpdate = SetUpdateLayout( false ); EditPaM aPaM; if ( eFormat == EETextFormat::Text ) aPaM = ReadText( rInput, rSel ); @@ -102,7 +101,7 @@ EditPaM ImpEditEngine::Read(SvStream& rInput, const OUString& rBaseURL, EETextFo } FormatFullDoc(); // perhaps a simple format is enough? - SetUpdateMode( _bUpdate ); + SetUpdateLayout( _bUpdate ); return aPaM; } @@ -277,7 +276,7 @@ void ImpEditEngine::WriteXML(SvStream& rOutput, const EditSelection& rSel) ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) { - DBG_ASSERT( GetUpdateMode(), "WriteRTF for UpdateMode = sal_False!" ); + DBG_ASSERT( IsUpdateLayout(), "WriteRTF for UpdateMode = sal_False!" ); CheckIdleFormatter(); if ( !IsFormatted() ) FormatDoc(); @@ -1085,7 +1084,7 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a // Remember the portions info in case of large text objects: // sleeper set up when Olli paragraphs not hacked! - if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && GetUpdateMode() && ( nTextPortions >= nBigObjectStart ) ) + if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && IsUpdateLayout() && ( nTextPortions >= nBigObjectStart ) ) { XParaPortionList* pXList = new XParaPortionList( GetRefDevice(), GetColumnWidth(aPaperSize), nStretchX, nStretchY ); pTxtObj->SetPortionInfo(std::unique_ptr<XParaPortionList>(pXList)); @@ -1134,13 +1133,13 @@ void ImpEditEngine::SetText( const EditTextObject& rTextObject ) { // Since setting a text object is not undo-able! ResetUndoManager(); - bool _bUpdate = GetUpdateMode(); + bool _bUpdate = IsUpdateLayout(); bool _bUndo = IsUndoEnabled(); SetText( OUString() ); EditPaM aPaM = aEditDoc.GetStartPaM(); - SetUpdateMode( false ); + SetUpdateLayout( false ); EnableUndo( false ); InsertText( rTextObject, EditSelection( aPaM, aPaM ) ); @@ -1148,7 +1147,7 @@ void ImpEditEngine::SetText( const EditTextObject& rTextObject ) SetRotation(rTextObject.GetRotation()); DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "From where comes the Undo in SetText ?!" ); - SetUpdateMode( _bUpdate ); + SetUpdateLayout( _bUpdate ); EnableUndo( _bUndo ); } @@ -2169,7 +2168,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, } rEditView.pImpEditView->SetEditSelection( aNext ); - FormatAndUpdate(); + FormatAndLayout(); aEditDoc.SetModified(true); } @@ -2497,7 +2496,7 @@ sal_Int32 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxSe if ( aNewPaM.GetIndex() > aNewPaM.GetNode()->Len() ) aNewPaM.SetIndex( aNewPaM.GetNode()->Len() ); pEditView->pImpEditView->SetEditSelection( aNewPaM ); - FormatAndUpdate( pEditView ); + FormatAndLayout( pEditView ); UndoActionEnd(); } else @@ -2955,7 +2954,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, SetModifyFlag( true ); if ( bLenChanged ) UpdateSelections(); - FormatAndUpdate(); + FormatAndLayout(); } return aNewSel; diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index d1846f1df880..69eeae09f515 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -50,13 +50,12 @@ void ImpEditEngine::SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ) sal_Int32 nStartPara = aEditDoc.GetPos( aSel.Min().GetNode() ); sal_Int32 nEndPara = aEditDoc.GetPos( aSel.Max().GetNode() ); - bool _bUpdate = GetUpdateMode(); - SetUpdateMode( false ); + bool _bUpdate = SetUpdateLayout( false ); for ( sal_Int32 n = nStartPara; n <= nEndPara; n++ ) SetStyleSheet( n, pStyle ); - SetUpdateMode( _bUpdate ); + SetUpdateLayout( _bUpdate ); } void ImpEditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle ) @@ -89,7 +88,7 @@ void ImpEditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle ) StartListening(*pStyle, DuplicateHandling::Prevent); ParaAttribsChanged( pNode ); } - FormatAndUpdate(); + FormatAndLayout(); } void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ) @@ -115,7 +114,7 @@ void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ) if ( bUsed ) { GetEditEnginePtr()->StyleSheetChanged( pStyle ); - FormatAndUpdate(); + FormatAndLayout(); } } @@ -130,7 +129,7 @@ void ImpEditEngine::RemoveStyleFromParagraphs( SfxStyleSheet const * pStyle ) ParaAttribsChanged( pNode ); } } - FormatAndUpdate(); + FormatAndLayout(); } void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index d486b2e8b7e3..67dd5b0bb768 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -41,15 +41,15 @@ using namespace ::com::sun::star::linguistic2; // ====================== Simple pass-through ======================= -void Outliner::SetUpdateMode( bool bUpdate ) +bool Outliner::SetUpdateLayout( bool bUpdate ) { - pEditEngine->SetUpdateMode( bUpdate ); + return pEditEngine->SetUpdateLayout( bUpdate ); } -bool Outliner::GetUpdateMode() const +bool Outliner::IsUpdateLayout() const { - return pEditEngine->GetUpdateMode(); + return pEditEngine->IsUpdateLayout(); } const SfxItemSet& Outliner::GetEmptyItemSet() const diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 73de85fff3e4..c9196a02295f 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -91,8 +91,7 @@ Paragraph* Outliner::Insert(const OUString& rText, sal_Int32 nAbsPos, sal_Int16 } else { - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); ImplBlockInsertionCallbacks( true ); pPara = new Paragraph( nDepth ); pParaList->Insert( std::unique_ptr<Paragraph>(pPara), nAbsPos ); @@ -103,7 +102,7 @@ Paragraph* Outliner::Insert(const OUString& rText, sal_Int32 nAbsPos, sal_Int16 pPara->nFlags |= ParaFlag::HOLDDEPTH; SetText( rText, pPara ); ImplBlockInsertionCallbacks( false ); - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); } bFirstParaIsEmpty = false; DBG_ASSERT(pEditEngine->GetParagraphCount()==pParaList->GetParagraphCount(),"SetText failed"); @@ -406,8 +405,7 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara ) return; } - const bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + const bool bUpdate = pEditEngine->SetUpdateLayout( false ); ImplBlockInsertionCallbacks( true ); if (rText.isEmpty()) @@ -481,7 +479,7 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara ) bFirstParaIsEmpty = false; ImplBlockInsertionCallbacks( false ); // Restore the update mode. - pEditEngine->SetUpdateMode(bUpdate, /*bRestoring=*/true); + pEditEngine->SetUpdateLayout(bUpdate, /*bRestoring=*/true); } // pView == 0 -> Ignore tabs @@ -559,9 +557,7 @@ bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara ) void Outliner::SetText( const OutlinerParaObject& rPObj ) { - - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); bool bUndo = pEditEngine->IsUndoEnabled(); EnableUndo( false ); @@ -587,7 +583,7 @@ void Outliner::SetText( const OutlinerParaObject& rPObj ) EnableUndo( bUndo ); ImplBlockInsertionCallbacks( false ); - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); DBG_ASSERT( pParaList->GetParagraphCount()==rPObj.Count(),"SetText failed"); DBG_ASSERT( pEditEngine->GetParagraphCount()==rPObj.Count(),"SetText failed"); @@ -595,9 +591,7 @@ void Outliner::SetText( const OutlinerParaObject& rPObj ) void Outliner::AddText( const OutlinerParaObject& rPObj, bool bAppend ) { - - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); ImplBlockInsertionCallbacks( true ); sal_Int32 nPara; @@ -636,7 +630,7 @@ void Outliner::AddText( const OutlinerParaObject& rPObj, bool bAppend ) ImplCheckParagraphs( nPara, pParaList->GetParagraphCount() ); ImplBlockInsertionCallbacks( false ); - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); } OUString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor ) @@ -729,8 +723,7 @@ void Outliner::ImplInitDepth( sal_Int32 nPara, sal_Int16 nDepth, bool bCreateUnd if( IsInUndo() ) return; - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); bool bUndo = bCreateUndo && IsUndoEnabled(); @@ -745,7 +738,7 @@ void Outliner::ImplInitDepth( sal_Int32 nPara, sal_Int16 nDepth, bool bCreateUnd InsertUndo( std::make_unique<OutlinerUndoChangeDepth>( this, nPara, nOldDepth, nDepth ) ); } - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); } void Outliner::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) @@ -1108,8 +1101,7 @@ ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat bool bOldUndo = pEditEngine->IsUndoEnabled(); EnableUndo( false ); - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); Clear(); @@ -1129,7 +1121,7 @@ ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat ImpFilterIndents( 0, nParas-1 ); ImplBlockInsertionCallbacks( false ); - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); EnableUndo( bOldUndo ); return nRet; @@ -1138,9 +1130,7 @@ ErrCode Outliner::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat void Outliner::ImpFilterIndents( sal_Int32 nFirstPara, sal_Int32 nLastPara ) { - - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); Paragraph* pLastConverted = nullptr; for( sal_Int32 nPara = nFirstPara; nPara <= nLastPara; nPara++ ) @@ -1162,7 +1152,7 @@ void Outliner::ImpFilterIndents( sal_Int32 nFirstPara, sal_Int32 nLastPara ) } } - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); } SfxUndoManager& Outliner::GetUndoManager() @@ -1177,9 +1167,7 @@ SfxUndoManager* Outliner::SetUndoManager(SfxUndoManager* pNew) void Outliner::ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount ) { - - bool bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( false ); + bool bUpdate = pEditEngine->SetUpdateLayout( false ); const sal_Int32 nStart = nStartPara; @@ -1219,7 +1207,7 @@ void Outliner::ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount ) pPara = pParaList->GetParagraph( nStartPara ); } - pEditEngine->SetUpdateMode( bUpdate ); + pEditEngine->SetUpdateLayout( bUpdate ); DBG_ASSERT(pParaList->GetParagraphCount()==pEditEngine->GetParagraphCount(),"ImpTextPasted failed"); } diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index cdac21edf282..83ab8aca2a5f 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -387,8 +387,7 @@ void OutlinerView::Select( Paragraph const * pParagraph, bool bSelect ) void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) { - bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( false ); + bool bUpdate = pOwner->pEditEngine->SetUpdateLayout( false ); if( !pOwner->IsInUndo() && pOwner->IsUndoEnabled() ) pOwner->UndoActionStart( OLUNDO_ATTR ); @@ -410,7 +409,7 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) if( !pOwner->IsInUndo() && pOwner->IsUndoEnabled() ) pOwner->UndoActionEnd(); - pEditView->SetEditEngineUpdateMode( bUpdate ); + pEditView->SetEditEngineUpdateLayout( bUpdate ); } ParaRange OutlinerView::ImpGetSelectedParagraphs( bool bIncludeHiddenChildren ) @@ -441,8 +440,7 @@ void OutlinerView::Indent( short nDiff ) return; const bool bOutlinerView = bool(pOwner->pEditEngine->GetControlWord() & EEControlBits::OUTLINER); - bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( false ); + bool bUpdate = pOwner->pEditEngine->SetUpdateLayout( false ); bool bUndo = !pOwner->IsInUndo() && pOwner->IsUndoEnabled(); @@ -558,7 +556,7 @@ void OutlinerView::Indent( short nDiff ) if ( bUpdate ) { - pEditView->SetEditEngineUpdateMode( true ); + pEditView->SetEditEngineUpdateLayout( true ); pEditView->ShowCursor(); } @@ -603,8 +601,7 @@ void OutlinerView::CollapseAll() void OutlinerView::ImplExpandOrCollaps( sal_Int32 nStartPara, sal_Int32 nEndPara, bool bExpand ) { - bool bUpdate = pOwner->GetUpdateMode(); - pOwner->SetUpdateMode( false ); + bool bUpdate = pOwner->SetUpdateLayout( false ); bool bUndo = !pOwner->IsInUndo() && pOwner->IsUndoEnabled(); if( bUndo ) @@ -626,7 +623,7 @@ void OutlinerView::ImplExpandOrCollaps( sal_Int32 nStartPara, sal_Int32 nEndPara if ( bUpdate ) { - pOwner->SetUpdateMode( true ); + pOwner->SetUpdateLayout( true ); pEditView->ShowCursor(); } } @@ -647,13 +644,13 @@ void OutlinerView::InsertText( const OutlinerParaObject& rParaObj ) pOwner->UndoActionStart( OLUNDO_INSERT ); - pOwner->pEditEngine->SetUpdateMode( false ); + pOwner->pEditEngine->SetUpdateLayout( false ); sal_Int32 nStart, nParaCount; nParaCount = pOwner->pEditEngine->GetParagraphCount(); sal_uInt16 nSize = ImpInitPaste( nStart ); pEditView->InsertText( rParaObj.GetTextObject() ); ImpPasted( nStart, nParaCount, nSize); - pEditView->SetEditEngineUpdateMode( true ); + pEditView->SetEditEngineUpdateLayout( true ); pOwner->UndoActionEnd(); @@ -682,7 +679,7 @@ void OutlinerView::Paste( bool bUseSpecial ) pOwner->UndoActionStart( OLUNDO_INSERT ); - pOwner->pEditEngine->SetUpdateMode( false ); + pOwner->pEditEngine->SetUpdateLayout( false ); pOwner->bPasting = true; if ( bUseSpecial ) @@ -698,7 +695,7 @@ void OutlinerView::Paste( bool bUseSpecial ) pOwner->ImplSetLevelDependentStyleSheet( nPara ); } - pEditView->SetEditEngineUpdateMode( true ); + pEditView->SetEditEngineUpdateLayout( true ); pOwner->UndoActionEnd(); pEditView->ShowCursor(); @@ -828,8 +825,7 @@ void OutlinerView::ToggleBullets() ESelection aSel( pEditView->GetSelection() ); aSel.Adjust(); - const bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( false ); + const bool bUpdate = pOwner->pEditEngine->SetUpdateLayout( false ); sal_Int16 nNewDepth = -2; const SvxNumRule* pDefaultBulletNumRule = nullptr; @@ -892,7 +888,7 @@ void OutlinerView::ToggleBullets() sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount; pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nEndPara, 0 ) ); - pOwner->pEditEngine->SetUpdateMode( bUpdate ); + pOwner->pEditEngine->SetUpdateLayout( bUpdate ); pOwner->UndoActionEnd(); } @@ -947,8 +943,7 @@ void OutlinerView::ApplyBulletsNumbering( } pOwner->UndoActionStart(OLUNDO_DEPTH); - const bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode(false); + const bool bUpdate = pOwner->pEditEngine->SetUpdateLayout(false); sal_Int32 nStartPara = 0; sal_Int32 nEndPara = 0; @@ -1061,7 +1056,7 @@ void OutlinerView::ApplyBulletsNumbering( pOwner->ImplCheckParagraphs( nStartPara, nParaCount ); pOwner->pEditEngine->QuickMarkInvalid( ESelection( nStartPara, 0, nParaCount, 0 ) ); - pOwner->pEditEngine->SetUpdateMode( bUpdate ); + pOwner->pEditEngine->SetUpdateLayout( bUpdate ); pOwner->UndoActionEnd(); } @@ -1086,8 +1081,7 @@ void OutlinerView::SwitchOffBulletsNumbering( } pOwner->UndoActionStart( OLUNDO_DEPTH ); - const bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( false ); + const bool bUpdate = pOwner->pEditEngine->SetUpdateLayout( false ); for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; ++nPara ) { @@ -1112,7 +1106,7 @@ void OutlinerView::SwitchOffBulletsNumbering( pOwner->ImplCheckParagraphs( nStartPara, nParaCount ); pOwner->pEditEngine->QuickMarkInvalid( ESelection( nStartPara, 0, nParaCount, 0 ) ); - pOwner->pEditEngine->SetUpdateMode( bUpdate ); + pOwner->pEditEngine->SetUpdateLayout( bUpdate ); pOwner->UndoActionEnd(); } @@ -1124,8 +1118,7 @@ void OutlinerView::RemoveAttribsKeepLanguages( bool bRemoveParaAttribs ) void OutlinerView::RemoveAttribs( bool bRemoveParaAttribs, bool bKeepLanguages ) { - bool bUpdate = pOwner->GetUpdateMode(); - pOwner->SetUpdateMode( false ); + bool bUpdate = pOwner->SetUpdateLayout( false ); pOwner->UndoActionStart( OLUNDO_ATTR ); if (bKeepLanguages) pEditView->RemoveAttribsKeepLanguages( bRemoveParaAttribs ); @@ -1143,7 +1136,7 @@ void OutlinerView::RemoveAttribs( bool bRemoveParaAttribs, bool bKeepLanguages ) } } pOwner->UndoActionEnd(); - pOwner->SetUpdateMode( bUpdate ); + pOwner->SetUpdateLayout( bUpdate ); } diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index 9e8111c8c75a..49eb5368e7a3 100644 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -148,7 +148,7 @@ bool SvxEditEngineForwarder::IsValid() const { // cannot reliably query EditEngine state // while in the middle of an update - return rEditEngine.GetUpdateMode(); + return rEditEngine.IsUpdateLayout(); } OUString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, std::optional<Color>& rpTxtColor, std::optional<Color>& rpFldColor ) diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx index e348e254ea28..21ffb0df2976 100644 --- a/editeng/source/uno/unoforou.cxx +++ b/editeng/source/uno/unoforou.cxx @@ -230,7 +230,7 @@ bool SvxOutlinerForwarder::IsValid() const { // cannot reliably query outliner state // while in the middle of an update - return rOutliner.GetUpdateMode(); + return rOutliner.IsUpdateLayout(); } SfxItemState SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index dc03c9355261..c86e56fca8d4 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -3619,8 +3619,7 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, SdrObject* pObj ) SdrOutliner& rOutliner = pText->ImpGetDrawOutliner(); rOutliner.Init( OutlinerMode::TextObject ); - bool bOldUpdateMode = rOutliner.GetUpdateMode(); - rOutliner.SetUpdateMode( false ); + bool bOldUpdateMode = rOutliner.SetUpdateLayout( false ); rOutliner.SetVertical( pText->IsVerticalWriting() ); sal_Int32 nParaIndex = 0; @@ -3666,7 +3665,7 @@ void SvxMSDffManager::ReadObjText( const OUString& rText, SdrObject* pObj ) } std::optional<OutlinerParaObject> pNewText = rOutliner.CreateParaObject(); rOutliner.Clear(); - rOutliner.SetUpdateMode( bOldUpdateMode ); + rOutliner.SetUpdateLayout( bOldUpdateMode ); pText->SetOutlinerParaObject( std::move(pNewText) ); // tdf#143315: restore stylesheet applied to Outliner's nodes when SdrTextObj initializes // its attributes, but removed by Outliner::Init, which calls Outliner::Clear. @@ -4471,9 +4470,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r if ( pParaObj ) { SdrOutliner& rOutliner = static_cast<SdrObjCustomShape*>(pRet)->ImpGetDrawOutliner(); - bool bOldUpdateMode = rOutliner.GetUpdateMode(); rOutliner.SetStyleSheetPool(static_cast< SfxStyleSheetPool* >(pRet->getSdrModelFromSdrObject().GetStyleSheetPool())); - rOutliner.SetUpdateMode( false ); + bool bOldUpdateMode = rOutliner.SetUpdateLayout( false ); rOutliner.SetText( *pParaObj ); ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::DEFAULT); pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); @@ -4501,7 +4499,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r } } rOutliner.Clear(); - rOutliner.SetUpdateMode( bOldUpdateMode ); + rOutliner.SetUpdateLayout( bOldUpdateMode ); } } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index d4bcb344c01f..33386122440b 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -2263,8 +2263,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* if ( ( pText->GetObjInventor() == SdrInventor::Default ) && ( pText->GetObjIdentifier() == OBJ_TITLETEXT ) ) // Outliner-Style for Title-Text object?!? (->of DL) rOutliner.Init( OutlinerMode::TitleObject ); // Outliner reset - bool bOldUpdateMode = rOutliner.GetUpdateMode(); - rOutliner.SetUpdateMode( false ); + bool bOldUpdateMode = rOutliner.SetUpdateLayout( false ); if ( pSheet ) { if ( rOutliner.GetStyleSheet( 0 ) != pSheet ) @@ -2374,7 +2373,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* } std::optional<OutlinerParaObject> pNewText = rOutliner.CreateParaObject(); rOutliner.Clear(); - rOutliner.SetUpdateMode( bOldUpdateMode ); + rOutliner.SetUpdateLayout( bOldUpdateMode ); rOutliner.EnableUndo(bUndoEnabled); pText->SetOutlinerParaObject( std::move(pNewText) ); } diff --git a/forms/source/richtext/richtextunowrapper.cxx b/forms/source/richtext/richtextunowrapper.cxx index 5f7a6353ea78..d9c4269216ea 100644 --- a/forms/source/richtext/richtextunowrapper.cxx +++ b/forms/source/richtext/richtextunowrapper.cxx @@ -103,7 +103,7 @@ namespace frm { EditView* pView = m_rEngine.GetView( view ); if ( pView ) - pView->ForceUpdate(); + pView->ForceLayoutCalculation(); } if ( m_pTextChangeListener ) diff --git a/forms/source/richtext/richtextvclcontrol.cxx b/forms/source/richtext/richtextvclcontrol.cxx index ff570eb74efa..cb4d613e36b2 100644 --- a/forms/source/richtext/richtextvclcontrol.cxx +++ b/forms/source/richtext/richtextvclcontrol.cxx @@ -88,12 +88,12 @@ namespace frm if ( HasChildPathFocus() ) getView().HideCursor(); - bool bOldUpdateMode = getEngine().GetUpdateMode(); // TODO: guard? - getEngine().SetUpdateMode( false ); + // TODO: guard? + bool bOldUpdateMode = getEngine().SetUpdateLayout( false ); getView().SetAttribs( _rAttributesToApply ); - getEngine().SetUpdateMode( bOldUpdateMode ); + getEngine().SetUpdateLayout( bOldUpdateMode ); getView().Invalidate(); if ( HasChildPathFocus() ) diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index c1fb0c2c8ffb..9f078cc5f0ab 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -214,8 +214,9 @@ public: /// bRestoring is used for LOK to update cursor visibility, specifically, /// when true, it means we are restoring the update mode after internally /// disabling it (f.e. during SetText to set/delete default text in Impress). - void SetUpdateMode(bool bUpdate, bool bRestoring = false); - bool GetUpdateMode() const; + /// @return previous value of update + bool SetUpdateLayout(bool bUpdate, bool bRestoring = false); + bool IsUpdateLayout() const; void SetBackgroundColor( const Color& rColor ); Color const & GetBackgroundColor() const; @@ -620,7 +621,7 @@ public: const ViewsType& GetEditViews() const; void SetUndoMode(bool b); - void FormatAndUpdate(EditView* pCurView, bool bCalledFromUndo = false); + void FormatAndLayout(EditView* pCurView, bool bCalledFromUndo = false); void Undo(EditView* pView); void Redo(EditView* pView); diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index c981c544f9e1..8332e516915d 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -283,8 +283,9 @@ public: css::uno::Reference<css::datatransfer::XTransferable> GetTransferable() const; // An EditView, so that when TRUE the update will be free from flickering: - void SetEditEngineUpdateMode( bool bUpdate ); - void ForceUpdate(); + // @return the previous bUpdateLayout state + bool SetEditEngineUpdateLayout( bool bUpdate ); + void ForceLayoutCalculation(); const SfxStyleSheet* GetStyleSheet() const; SfxStyleSheet* GetStyleSheet(); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index c340bd15c8c0..999981c69af0 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -697,8 +697,9 @@ public: void SetMaxDepth( sal_Int16 nDepth ); sal_Int16 GetMaxDepth() const { return nMaxDepth; } - void SetUpdateMode( bool bUpdate ); - bool GetUpdateMode() const; + /// @return previous value of bUpdateLayout state + bool SetUpdateLayout( bool bUpdate ); + bool IsUpdateLayout() const; void Clear(); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 93e16239dfca..9933ff00dcff 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -375,7 +375,7 @@ tools::Long ScColumn::GetNeededSize( // save in document ? std::unique_ptr<ScFieldEditEngine> pEngine = rDocument.CreateFieldEditEngine(); - pEngine->SetUpdateMode( false ); + pEngine->SetUpdateLayout( false ); bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER ); EEControlBits nCtrl = pEngine->GetControlWord(); if ( bTextWysiwyg ) @@ -473,7 +473,7 @@ tools::Long ScColumn::GetNeededSize( bool bEngineVertical = pEngine->IsEffectivelyVertical(); pEngine->SetVertical( bAsianVertical ); - pEngine->SetUpdateMode( true ); + pEngine->SetUpdateLayout( true ); bool bEdWidth = bWidth; if ( eOrient != SvxCellOrientation::Standard && eOrient != SvxCellOrientation::Stacked ) diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 28f19df43539..d94dbdfb25a9 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -459,7 +459,7 @@ ScFieldEditEngine& ScDocument::GetEditEngine() if ( !mpEditEngine ) { mpEditEngine.reset( new ScFieldEditEngine(this, GetEnginePool(), GetEditPool()) ); - mpEditEngine->SetUpdateMode( false ); + mpEditEngine->SetUpdateLayout( false ); mpEditEngine->EnableUndo( false ); mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); ApplyAsianEditSettings( *mpEditEngine ); @@ -473,7 +473,7 @@ ScNoteEditEngine& ScDocument::GetNoteEngine() { ScMutationGuard aGuard(*this, ScMutationGuardFlags::CORE); mpNoteEngine.reset( new ScNoteEditEngine( GetEnginePool(), GetEditPool() ) ); - mpNoteEngine->SetUpdateMode( false ); + mpNoteEngine->SetUpdateLayout( false ); mpNoteEngine->EnableUndo( false ); mpNoteEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); ApplyAsianEditSettings( *mpNoteEngine ); @@ -1133,8 +1133,7 @@ std::unique_ptr<ScFieldEditEngine> ScDocument::CreateFieldEditEngine() { // #i66209# previous use might not have restored update mode, // ensure same state as for a new EditEngine (UpdateMode = true) - if ( !pCacheFieldEditEngine->GetUpdateMode() ) - pCacheFieldEditEngine->SetUpdateMode(true); + pCacheFieldEditEngine->SetUpdateLayout(true); } pNewEditEngine = std::move(pCacheFieldEditEngine); diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 3939978633f3..9bb62cdb2bf6 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -218,7 +218,7 @@ void ScStyleSheetPool::CreateStandardStyles() SfxItemSet* pSet = nullptr; SfxItemSet* pHFSet = nullptr; ScEditEngineDefaulter aEdEngine( EditEngine::CreatePool().get(), true ); - aEdEngine.SetUpdateMode( false ); + aEdEngine.SetUpdateLayout( false ); std::unique_ptr<EditTextObject> pEmptyTxtObj = aEdEngine.CreateTextObject(); std::unique_ptr<EditTextObject> pTxtObj; ScPageHFItem aHeaderItem( ATTR_PAGE_HEADERRIGHT ); diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index f61f870aa4d7..c025b1a8d98f 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -550,16 +550,14 @@ void ScEditEngineDefaulter::SetDefaults( const SfxItemSet& rSet, bool bRememberC const SfxItemSet& rNewSet = bRememberCopy ? *pDefaults : rSet; bool bUndo = IsUndoEnabled(); EnableUndo( false ); - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); sal_Int32 nPara = GetParagraphCount(); for ( sal_Int32 j=0; j<nPara; j++ ) { SetParaAttribs( j, rNewSet ); } if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); if ( bUndo ) EnableUndo( true ); } @@ -597,74 +595,62 @@ const SfxItemSet& ScEditEngineDefaulter::GetDefaults() void ScEditEngineDefaulter::SetTextCurrentDefaults( const EditTextObject& rTextObject ) { - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); SetText( rTextObject ); if ( pDefaults ) SetDefaults( *pDefaults, false ); if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } void ScEditEngineDefaulter::SetTextNewDefaults( const EditTextObject& rTextObject, const SfxItemSet& rSet, bool bRememberCopy ) { - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); SetText( rTextObject ); SetDefaults( rSet, bRememberCopy ); if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } void ScEditEngineDefaulter::SetTextNewDefaults( const EditTextObject& rTextObject, std::unique_ptr<SfxItemSet> pSet ) { - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); SetText( rTextObject ); SetDefaults( std::move(pSet) ); if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } void ScEditEngineDefaulter::SetTextCurrentDefaults( const OUString& rText ) { - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); SetText( rText ); if ( pDefaults ) SetDefaults( *pDefaults, false ); if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } void ScEditEngineDefaulter::SetTextNewDefaults( const OUString& rText, const SfxItemSet& rSet ) { - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); SetText( rText ); SetDefaults( rSet ); if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } void ScEditEngineDefaulter::SetTextNewDefaults( const OUString& rText, std::unique_ptr<SfxItemSet> pSet ) { - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); SetText( rText ); SetDefaults( std::move(pSet) ); if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } void ScEditEngineDefaulter::RepeatDefaults() @@ -680,9 +666,7 @@ void ScEditEngineDefaulter::RepeatDefaults() void ScEditEngineDefaulter::RemoveParaAttribs() { std::optional<SfxItemSet> pCharItems; - bool bUpdateMode = GetUpdateMode(); - if ( bUpdateMode ) - SetUpdateMode( false ); + bool bUpdateMode = SetUpdateLayout( false ); sal_Int32 nParCount = GetParagraphCount(); for (sal_Int32 nPar=0; nPar<nParCount; nPar++) { @@ -746,7 +730,7 @@ void ScEditEngineDefaulter::RemoveParaAttribs() } } if ( bUpdateMode ) - SetUpdateMode( true ); + SetUpdateLayout( true ); } ScTabEditEngine::ScTabEditEngine( ScDocument* pDoc ) diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 51e0fe9121d9..6292a86e007a 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -573,8 +573,7 @@ XclExpStringRef XclExpStringHelper::CreateCellString( // formatted cell ScEditEngineDefaulter& rEE = rRoot.GetEditEngine(); - bool bOldUpdateMode = rEE.GetUpdateMode(); - rEE.SetUpdateMode( true ); + bool bOldUpdateMode = rEE.SetUpdateLayout( true ); // default items const SfxItemSet& rItemSet = pCellAttr ? pCellAttr->GetItemSet() : rRoot.GetDoc().GetDefPattern()->GetItemSet(); @@ -585,7 +584,7 @@ XclExpStringRef XclExpStringHelper::CreateCellString( // create the string rEE.SetTextCurrentDefaults(rEditText); xString = lclCreateFormattedString( rRoot, rEE, &rLinkHelper, nFlags, nMaxLen ); - rEE.SetUpdateMode( bOldUpdateMode ); + rEE.SetUpdateLayout( bOldUpdateMode ); return xString; } @@ -598,12 +597,11 @@ XclExpStringRef XclExpStringHelper::CreateString( if( const OutlinerParaObject* pParaObj = rTextObj.GetOutlinerParaObject() ) { EditEngine& rEE = rRoot.GetDrawEditEngine(); - bool bOldUpdateMode = rEE.GetUpdateMode(); - rEE.SetUpdateMode( true ); + bool bOldUpdateMode = rEE.SetUpdateLayout( true ); // create the string rEE.SetText( pParaObj->GetTextObject() ); xString = lclCreateFormattedString( rRoot, rEE, nullptr, nFlags, EXC_STR_MAXLEN ); - rEE.SetUpdateMode( bOldUpdateMode ); + rEE.SetUpdateLayout( bOldUpdateMode ); // limit formats - TODO: BIFF dependent if( !xString->IsEmpty() ) { @@ -626,11 +624,10 @@ XclExpStringRef XclExpStringHelper::CreateString( { XclExpStringRef xString; EditEngine& rEE = rRoot.GetDrawEditEngine(); - bool bOldUpdateMode = rEE.GetUpdateMode(); - rEE.SetUpdateMode( true ); + bool bOldUpdateMode = rEE.SetUpdateLayout( true ); rEE.SetText( rEditObj ); xString = lclCreateFormattedString( rRoot, rEE, nullptr, nFlags, EXC_STR_MAXLEN ); - rEE.SetUpdateMode( bOldUpdateMode ); + rEE.SetUpdateLayout( bOldUpdateMode ); // limit formats - TODO: BIFF dependent if( !xString->IsEmpty() ) { @@ -685,8 +682,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> ); // edit engine - bool bOldUpdateMode = mrEE.GetUpdateMode(); - mrEE.SetUpdateMode( true ); + bool bOldUpdateMode = mrEE.SetUpdateLayout( true ); mrEE.SetText( *pTextObj ); // font information @@ -874,7 +870,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico nHeight += nParaHeight; } - mrEE.SetUpdateMode( bOldUpdateMode ); + mrEE.SetUpdateLayout( bOldUpdateMode ); if( !aText.isEmpty() ) { diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 338320d67c00..59a1f7fd887f 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -362,7 +362,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const ScEditEngineDefaulter& rEE = *mrData.mxEditEngine; rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM)); rEE.SetEditTextObjectPool( GetDoc().GetEditPool() ); - rEE.SetUpdateMode( false ); + rEE.SetUpdateLayout( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); } @@ -376,7 +376,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const mrData.mxHFEditEngine = std::make_shared<ScHeaderEditEngine>( EditEngine::CreatePool().get() ); ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine; rEE.SetRefMapMode(MapMode(MapUnit::MapTwip)); // headers/footers use twips as default metric - rEE.SetUpdateMode( false ); + rEE.SetUpdateLayout( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); @@ -400,7 +400,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const mrData.mxDrawEditEng = std::make_shared<EditEngine>( &GetDoc().GetDrawLayer()->GetItemPool() ); EditEngine& rEE = *mrData.mxDrawEditEng; rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM)); - rEE.SetUpdateMode( false ); + rEE.SetUpdateLayout( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); } diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 9c64d56d0f79..e6447ee1a863 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -1272,8 +1272,7 @@ bool ScHTMLExport::WriteFieldText( const EditTextObject* pData ) } if ( bFields ) { - bool bOldUpdateMode = rEngine.GetUpdateMode(); - rEngine.SetUpdateMode( true ); // no portions if not formatted + bool bOldUpdateMode = rEngine.SetUpdateLayout( true ); // no portions if not formatted for ( sal_Int32 nPar=0; nPar < nParas; nPar++ ) { if ( nPar > 0 ) @@ -1309,7 +1308,7 @@ bool ScHTMLExport::WriteFieldText( const EditTextObject* pData ) nStart = nEnd; } } - rEngine.SetUpdateMode( bOldUpdateMode ); + rEngine.SetUpdateLayout( bOldUpdateMode ); } return bFields; } diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 8a7804102246..fe66af90b95f 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -586,7 +586,7 @@ void WorkbookGlobals::initialize() mxEditEngine.reset( new ScEditEngineDefaulter( rDoc.GetEnginePool() ) ); mxEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); mxEditEngine->SetEditTextObjectPool( rDoc.GetEditPool() ); - mxEditEngine->SetUpdateMode( false ); + mxEditEngine->SetUpdateLayout( false ); mxEditEngine->EnableUndo( false ); mxEditEngine->SetControlWord( mxEditEngine->GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 1b8b7e01a930..e06435de3697 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -66,7 +66,7 @@ ScEEImport::ScEEImport( ScDocument* pDocP, const ScRange& rRange ) : const ScPatternAttr* pPattern = mpDoc->GetPattern( maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() ); mpEngine.reset( new ScTabEditEngine(*pPattern, mpDoc->GetEditPool(), mpDoc, mpDoc->GetEditPool()) ); - mpEngine->SetUpdateMode( false ); + mpEngine->SetUpdateLayout( false ); mpEngine->EnableUndo( false ); } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index ae36dc9a32ab..b84dd4ff4622 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1644,7 +1644,7 @@ ScEditEngineDefaulter* ScXMLImport::GetEditEngine() mpEditEngine.reset(new ScEditEngineDefaulter(pDoc->GetEnginePool())); mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); mpEditEngine->SetEditTextObjectPool(pDoc->GetEditPool()); - mpEditEngine->SetUpdateMode(false); + mpEditEngine->SetUpdateLayout(false); mpEditEngine->EnableUndo(false); mpEditEngine->SetControlWord(mpEditEngine->GetControlWord() & ~EEControlBits::ALLOWBIGOBJS); } diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index ffaa156877ba..3b78798d05c0 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -1504,7 +1504,7 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { ScViewData& rViewData = mpViewShell->GetViewData(); const EditEngine* pEditEng = rViewData.GetEditView(meSplitPos)->GetEditEngine(); - if (pEditEng && pEditEng->GetUpdateMode()) + if (pEditEng && pEditEng->IsUpdateLayout()) { mpTempAccEdit = new ScAccessibleEditObject(this, rViewData.GetEditView(meSplitPos), mpViewShell->GetWindowByPos(meSplitPos), GetCurrentCellName(), diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index cd76922aff2a..504747c8ee28 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -403,7 +403,7 @@ handle_r1c1: if (!nCount) { - mpEditEngine->SetUpdateMode( false ); + mpEditEngine->SetUpdateLayout( false ); pRangeFindList.reset(new ScRangeFindList( pDocSh->GetTitle() )); } @@ -424,7 +424,7 @@ handle_r1c1: if (nCount) { - mpEditEngine->SetUpdateMode( true ); + mpEditEngine->SetUpdateLayout( true ); pDocSh->Broadcast( SfxHint( SfxHintId::ScShowRangeFinder ) ); } @@ -2326,11 +2326,11 @@ void ScInputHandler::RemoveAdjust() void ScInputHandler::RemoveRangeFinder() { // Delete pRangeFindList and colors - mpEditEngine->SetUpdateMode(false); + mpEditEngine->SetUpdateLayout(false); sal_Int32 nCount = mpEditEngine->GetParagraphCount(); // Could just have been inserted for (sal_Int32 i=0; i<nCount; i++) mpEditEngine->RemoveCharAttribs( i, EE_CHAR_COLOR ); - mpEditEngine->SetUpdateMode(true); + mpEditEngine->SetUpdateLayout(true); EditView* pActiveView = pTopView ? pTopView : pTableView; pActiveView->ShowCursor( false ); @@ -2401,7 +2401,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn if (bStartInputMode) { // UpdateMode is enabled again in ScViewData::SetEditEngine (and not needed otherwise) - mpEditEngine->SetUpdateMode( false ); + mpEditEngine->SetUpdateLayout( false ); // Take over attributes in EditEngine const ScPatternAttr* pPattern = rDoc.GetPattern( aCursorPos.Col(), @@ -2582,7 +2582,7 @@ void ScInputHandler::SyncViews( const EditView* pSourceView ) IMPL_LINK_NOARG(ScInputHandler, ModifyHdl, LinkParamNone*, void) { if ( !bInOwnChange && ( eMode==SC_INPUT_TYPE || eMode==SC_INPUT_TABLE ) && - mpEditEngine && mpEditEngine->GetUpdateMode() && pInputWin ) + mpEditEngine && mpEditEngine->IsUpdateLayout() && pInputWin ) { // Update input line from ModifyHdl for changes that are not // wrapped by DataChanging/DataChanged calls (like Drag&Drop) @@ -2890,12 +2890,12 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const OUString* pInitText, S if (eMode==SC_INPUT_TABLE || eMode==SC_INPUT_TYPE) { if (pTableView) - pTableView->SetEditEngineUpdateMode(true); + pTableView->SetEditEngineUpdateLayout(true); } else { if (pTopView) - pTopView->SetEditEngineUpdateMode(true); + pTopView->SetEditEngineUpdateLayout(true); } if (eNewMode != eOldMode) @@ -3058,9 +3058,9 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) } // After RemoveAdjust, the EditView must not be repainted (has wrong font size etc). - // SetUpdateMode must come after CompleteOnlineSpelling. + // SetUpdateLayout must come after CompleteOnlineSpelling. // The view is hidden in any case below (Broadcast). - mpEditEngine->SetUpdateMode( false ); + mpEditEngine->SetUpdateLayout( false ); if ( bModified && !bForget ) // What is being entered (text/object)? { @@ -4429,10 +4429,10 @@ void ScInputHandler::InputReplaceSelection( const OUString& rStr ) EditView* pView = GetFuncEditView(); if (pView) { - pView->SetEditEngineUpdateMode( false ); + pView->SetEditEngineUpdateLayout( false ); pView->GetEditEngine()->SetText( aFormText ); pView->SetSelection( ESelection(0,nFormSelStart, 0,nFormSelEnd) ); - pView->SetEditEngineUpdateMode( true ); + pView->SetEditEngineUpdateLayout( true ); } bModified = true; } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 1e7b0225e2ad..76e57e1833ca 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -414,7 +414,7 @@ void ScInputWindow::Select() pView->SetSelection( ESelection(0, nStartPos, 0, nEndPos) ); pScMod->InputChanged(pView); SetOkCancelMode(); - pView->SetEditEngineUpdateMode(true); + pView->SetEditEngineUpdateLayout(true); } } } @@ -584,7 +584,7 @@ void ScInputWindow::SetFuncString( const OUString& rString, bool bDoEdit ) if ( bDoEdit ) SetOkCancelMode(); // Not the case if immediately followed by Enter/Cancel - pView->SetEditEngineUpdateMode(true); + pView->SetEditEngineUpdateLayout(true); } void ScInputWindow::SetPosString( const OUString& rStr ) @@ -1534,7 +1534,7 @@ void ScTextWnd::InitEditEngine() m_xEditEngine = std::move(pNew); Size barSize = GetOutputSizePixel(); - m_xEditEngine->SetUpdateMode( false ); + m_xEditEngine->SetUpdateLayout( false ); m_xEditEngine->SetPaperSize( GetDrawingArea()->get_ref_device().PixelToLogic(Size(barSize.Width(),10000)) ); m_xEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( m_xEditEngine->GetWordDelimiters() ) ); @@ -1560,7 +1560,7 @@ void ScTextWnd::InitEditEngine() if ( pHdl ) //! Test if it's the right InputHdl? bFilled = pHdl->GetTextAndFields(static_cast<ScEditEngineDefaulter&>(*m_xEditEngine)); - m_xEditEngine->SetUpdateMode( true ); + m_xEditEngine->SetUpdateLayout( true ); // aString is the truth ... if (bFilled && m_xEditEngine->GetText() == aString) @@ -1651,7 +1651,7 @@ bool ScTextWnd::MouseButtonDown( const MouseEvent& rMEvt ) bool bClickOnSelection = false; if (m_xEditView) { - m_xEditView->SetEditEngineUpdateMode( true ); + m_xEditView->SetEditEngineUpdateLayout( true ); bClickOnSelection = m_xEditView->IsSelectionAtPoint(rMEvt.GetPosPixel()); } if (!bClickOnSelection) @@ -2036,7 +2036,7 @@ void ScTextWnd::MakeDialogEditView() pNew->SetExecuteURL( false ); m_xEditEngine = std::move(pNew); - m_xEditEngine->SetUpdateMode( false ); + m_xEditEngine->SetUpdateLayout( false ); m_xEditEngine->SetWordDelimiters( m_xEditEngine->GetWordDelimiters() + "=" ); m_xEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) ); @@ -2046,7 +2046,7 @@ void ScTextWnd::MakeDialogEditView() if ( bIsRTL ) lcl_ModifyRTLDefaults( *pSet ); static_cast<ScEditEngineDefaulter*>(m_xEditEngine.get())->SetDefaults( std::move(pSet) ); - m_xEditEngine->SetUpdateMode( true ); + m_xEditEngine->SetUpdateLayout( true ); m_xEditView = std::make_unique<EditView>(m_xEditEngine.get(), nullptr); m_xEditView->setEditViewCallbacks(this); diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d0ad63f1ff95..1972c9f364bd 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1165,9 +1165,7 @@ void ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, // EditEngine isn't accessed again. bool bLoseContent = rDoc.IsImportingXML(); - bool bUpdateMode(rEngine.GetUpdateMode()); - if (bUpdateMode) - rEngine.SetUpdateMode(false); + const bool bUpdateMode = rEngine.SetUpdateLayout(false); std::vector<std::unique_ptr<ScMyRememberItem>> aRememberItems; @@ -1201,7 +1199,7 @@ void ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, // #i61702# if the content isn't accessed, there's no need to set the UpdateMode again if ( bUpdateMode && !bLoseContent ) - rEngine.SetUpdateMode(true); + rEngine.SetUpdateLayout(true); } else { diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 243be01e3f17..8dcdfe12a2e8 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -594,7 +594,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) aSel.Adjust(); sal_Int32 nNewEnd = aSel.nEndPos; - bool bUpdate = pOutliner->GetUpdateMode(); + bool bUpdate = pOutliner->IsUpdateLayout(); bool bChanged = false; //! GetPortions and GetAttribs should be const! @@ -624,7 +624,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) if (!bChanged) { if (bUpdate) - pOutliner->SetUpdateMode( false ); + pOutliner->SetUpdateLayout( false ); OUString aName = ScResId( STR_UNDO_DELETECONTENTS ); ViewShellId nViewShellId(-1); if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell()) @@ -648,7 +648,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView ) if (bUpdate && bChanged) { pOutliner->GetUndoManager().LeaveListAction(); - pOutliner->SetUpdateMode( true ); + pOutliner->SetUpdateLayout( true ); } if ( aOldSel == aSel ) // aSel is adjusted diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index f51e8f49290f..6a93ec79be9a 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -129,8 +129,7 @@ static void lcl_RemoveAttribs( EditView& rEditView ) { ScEditEngineDefaulter* pEngine = static_cast<ScEditEngineDefaulter*>(rEditView.GetEditEngine()); - bool bOld = pEngine->GetUpdateMode(); - pEngine->SetUpdateMode(false); + bool bOld = pEngine->SetUpdateLayout(false); OUString aName = ScResId( STR_UNDO_DELETECONTENTS ); ViewShellId nViewShellId(-1); @@ -143,7 +142,7 @@ static void lcl_RemoveAttribs( EditView& rEditView ) pEngine->GetUndoManager().LeaveListAction(); - pEngine->SetUpdateMode(bOld); + pEngine->SetUpdateLayout(bOld); } static void lclInsertCharacter( EditView* pTableView, EditView* pTopView, sal_Unicode cChar ) @@ -1153,12 +1152,11 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq) // apply EditEngine* pEngine = pEditView->GetEditEngine(); - bool bOld = pEngine->GetUpdateMode(); - pEngine->SetUpdateMode(false); + bool bOld = pEngine->SetUpdateLayout(false); pEditView->SetAttribs( aSet ); - pEngine->SetUpdateMode(bOld); + pEngine->SetUpdateLayout(bOld); pEditView->Invalidate(); ScInputHandler* pHdl = GetMyInputHdl(); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index b663c90d6424..36e1e01dd758 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2155,7 +2155,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co std::unique_ptr<ScFieldEditEngine> ScOutputData::CreateOutputEditEngine() { std::unique_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(mpDoc, mpDoc->GetEnginePool())); - pEngine->SetUpdateMode( false ); + pEngine->SetUpdateLayout( false ); // a RefDevice always has to be set, otherwise EditEngine would create a VirtualDevice pEngine->SetRefDevice( pFmtDevice ); EEControlBits nCtrl = pEngine->GetControlWord(); @@ -2176,7 +2176,7 @@ std::unique_ptr<ScFieldEditEngine> ScOutputData::CreateOutputEditEngine() static void lcl_ClearEdit( EditEngine& rEngine ) // text and attributes { - rEngine.SetUpdateMode( false ); + rEngine.SetUpdateLayout( false ); rEngine.SetText(EMPTY_OUSTRING); // do not keep any para-attributes @@ -2209,9 +2209,7 @@ static bool lcl_SafeIsValue( ScRefCellValue& rCell ) static void lcl_ScaleFonts( EditEngine& rEngine, tools::Long nPercent ) { - bool bUpdateMode = rEngine.GetUpdateMode(); - if ( bUpdateMode ) - rEngine.SetUpdateMode( false ); + bool bUpdateMode = rEngine.SetUpdateLayout( false ); sal_Int32 nParCount = rEngine.GetParagraphCount(); for (sal_Int32 nPar=0; nPar<nParCount; nPar++) @@ -2244,7 +2242,7 @@ static void lcl_ScaleFonts( EditEngine& rEngine, tools::Long nPercent ) } if ( bUpdateMode ) - rEngine.SetUpdateMode( true ); + rEngine.SetUpdateLayout( true ); } static tools::Long lcl_GetEditSize( EditEngine& rEngine, bool bWidth, bool bSwap, Degree100 nAttrRotate ) @@ -2718,9 +2716,9 @@ bool ScOutputData::DrawEditParam::adjustHorAlignment(ScFieldEditEngine* pEngine) SvxAdjust eEditAdjust = (meHorJustResult == SvxCellHorJustify::Center) ? SvxAdjust::Center : SvxAdjust::Right; - pEngine->SetUpdateMode(false); + pEngine->SetUpdateLayout(false); pEngine->SetDefaultItem( SvxAdjustItem(eEditAdjust, EE_PARA_JUST) ); - pEngine->SetUpdateMode(true); + pEngine->SetUpdateLayout(true); return true; } return false; @@ -2952,7 +2950,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) else if ( mbUseStyleColor && mbForceAutoColor ) lcl_SetEditColor( *rParam.mpEngine, COL_AUTO ); //! or have a flag at EditEngine - rParam.mpEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight + rParam.mpEngine->SetUpdateLayout( true ); // after SetText, before CalcTextWidth/GetTextHeight // Get final output area using the calculated width @@ -3330,7 +3328,7 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam) else if ( mbUseStyleColor && mbForceAutoColor ) lcl_SetEditColor( *rParam.mpEngine, COL_AUTO ); //! or have a flag at EditEngine - rParam.mpEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight + rParam.mpEngine->SetUpdateLayout( true ); // after SetText, before CalcTextWidth/GetTextHeight // Get final output area using the calculated width @@ -3573,7 +3571,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam) else if ( mbUseStyleColor && mbForceAutoColor ) lcl_SetEditColor( *rParam.mpEngine, COL_AUTO ); //! or have a flag at EditEngine - rParam.mpEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight + rParam.mpEngine->SetUpdateLayout( true ); // after SetText, before CalcTextWidth/GetTextHeight // Get final output area using the calculated width @@ -3830,7 +3828,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) else if ( mbUseStyleColor && mbForceAutoColor ) lcl_SetEditColor( *rParam.mpEngine, COL_AUTO ); //! or have a flag at EditEngine - rParam.mpEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight + rParam.mpEngine->SetUpdateLayout( true ); // after SetText, before CalcTextWidth/GetTextHeight // Get final output area using the calculated width @@ -4129,7 +4127,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) else if ( mbUseStyleColor && mbForceAutoColor ) lcl_SetEditColor( *rParam.mpEngine, COL_AUTO ); //! or have a flag at EditEngine - rParam.mpEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight + rParam.mpEngine->SetUpdateLayout( true ); // after SetText, before CalcTextWidth/GetTextHeight // Get final output area using the calculated width @@ -4762,7 +4760,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) else if ( mbUseStyleColor && mbForceAutoColor ) lcl_SetEditColor( *pEngine, COL_AUTO ); //! or have a flag at EditEngine - pEngine->SetUpdateMode( true ); // after SetText, before CalcTextWidth/GetTextHeight + pEngine->SetUpdateLayout( true ); // after SetText, before CalcTextWidth/GetTextHeight tools::Long nEngineWidth = static_cast<tools::Long>(pEngine->CalcTextWidth()); tools::Long nEngineHeight = pEngine->GetTextHeight(); @@ -4978,7 +4976,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) if (eHorJust==SvxCellHorJustify::Right || eHorJust==SvxCellHorJustify::Center) { - pEngine->SetUpdateMode( false ); + pEngine->SetUpdateLayout( false ); SvxAdjust eSvxAdjust = (eHorJust==SvxCellHorJustify::Right) ? @@ -4992,7 +4990,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) else pEngine->SetPaperSize(aPaperSize); - pEngine->SetUpdateMode( true ); + pEngine->SetUpdateLayout( true ); } } else diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 8e76f4d985aa..fdf24fe0cffa 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1787,7 +1787,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, pEditView[eWhich]->SetLOKSpecialVisArea(aVisPTwips); // UpdateMode has been disabled in ScInputHandler::StartTable // must be enabled before EditGrowY (GetTextHeight) - pNewEngine->SetUpdateMode( true ); + pNewEngine->SetUpdateLayout( true ); pNewEngine->SetStatusEventHdl( LINK( this, ScViewData, EditEngineHdl ) ); diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 3734d4aa70ea..0fea961a6902 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -935,7 +935,7 @@ SdOutliner* SdDrawDocument::GetInternalOutliner(bool bCreateOutliner) // This outliner is only used to create special text objects. As no // information about portions is saved in this outliner, the update mode // can/should always remain sal_False. - mpInternalOutliner->SetUpdateMode( false ); + mpInternalOutliner->SetUpdateLayout( false ); mpInternalOutliner->EnableUndo( false ); if (mpDocSh) @@ -945,7 +945,7 @@ SdOutliner* SdDrawDocument::GetInternalOutliner(bool bCreateOutliner) mpInternalOutliner->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetStyleSheetPool())); } - DBG_ASSERT( !mpInternalOutliner || ( ! mpInternalOutliner->GetUpdateMode() ) , "InternalOutliner: UpdateMode = sal_True !" ); + DBG_ASSERT( !mpInternalOutliner || ( ! mpInternalOutliner->IsUpdateLayout() ) , "InternalOutliner: UpdateMode = sal_True !" ); DBG_ASSERT( !mpInternalOutliner || ( ! mpInternalOutliner->IsUndoEnabled() ), "InternalOutliner: Undo = sal_True !" ); // If you add stuff here, always clear it out. diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index bda437336226..62f0936ff4bb 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -963,7 +963,7 @@ void SdDrawDocument::SpellObject(SdrTextObj* pObj) mbHasOnlineSpellErrors = false; SdOutliner* pOutl = GetInternalOutliner(); - pOutl->SetUpdateMode(true); + pOutl->SetUpdateLayout(true); Link<EditStatus&,void> aEvtHdl = pOutl->GetStatusEventHdl(); pOutl->SetStatusEventHdl(LINK(this, SdDrawDocument, OnlineSpellEventHdl)); @@ -1003,7 +1003,7 @@ void SdDrawDocument::SpellObject(SdrTextObj* pObj) } pOutl->SetStatusEventHdl(aEvtHdl); - pOutl->SetUpdateMode(false); + pOutl->SetUpdateLayout(false); pOutl->Init( nOldOutlMode ); mbHasOnlineSpellErrors = false; } diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index ade3c3148d22..7dd4d94493bf 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2375,13 +2375,12 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO pOutl->SetEditTextObjectPool(pPool); pOutl->SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(getSdrModelFromSdrPage().GetStyleSheetPool())); pOutl->EnableUndo(false); - pOutl->SetUpdateMode( false ); + pOutl->SetUpdateLayout( false ); } OutlinerMode nOutlMode = pOutl->GetOutlinerMode(); Size aPaperSize = pOutl->GetPaperSize(); - bool bUpdateMode = pOutl->GetUpdateMode(); - pOutl->SetUpdateMode(false); + bool bUpdateMode = pOutl->SetUpdateLayout(false); pOutl->SetParaAttribs( 0, pOutl->GetEmptyItemSet() ); // Always set the object's StyleSheet at the Outliner to @@ -2481,7 +2480,7 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO // restore the outliner pOutl->Init( nOutlMode ); pOutl->SetParaAttribs( 0, pOutl->GetEmptyItemSet() ); - pOutl->SetUpdateMode( bUpdateMode ); + pOutl->SetUpdateLayout( bUpdateMode ); pOutl->SetPaperSize( aPaperSize ); } } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index a73561ee446a..dee808cc1823 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -1400,8 +1400,7 @@ OUString HtmlExport::ParagraphToHTMLString( SdrOutliner const * pOutliner, sal_I // TODO: MALTE!!! EditEngine& rEditEngine = *const_cast<EditEngine*>(&pOutliner->GetEditEngine()); - bool bOldUpdateMode = rEditEngine.GetUpdateMode(); - rEditEngine.SetUpdateMode(true); + bool bOldUpdateMode = rEditEngine.SetUpdateLayout(true); Paragraph* pPara = pOutliner->GetParagraph(nPara); if(nullptr == pPara) @@ -1426,7 +1425,7 @@ OUString HtmlExport::ParagraphToHTMLString( SdrOutliner const * pOutliner, sal_I nPos1 = nPos2; } aStr.append(aState.Flush()); - rEditEngine.SetUpdateMode(bOldUpdateMode); + rEditEngine.SetUpdateLayout(bOldUpdateMode); return aStr.makeStringAndClear(); } diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 6d248b35e89e..b51f5973ec20 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -563,7 +563,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest const & rReq ) ::Outliner aOutliner( GetAnnotationPool(),OutlinerMode::TextObject ); SdDrawDocument::SetCalcFieldValueHdl( &aOutliner ); - aOutliner.SetUpdateMode( true ); + aOutliner.SetUpdateLayout( true ); OUString aStr(SdResId(STR_ANNOTATION_REPLY)); OUString sAuthor( xAnnotation->getAuthor() ); diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index 31d1891c2e0e..c3b797f239ce 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -249,7 +249,7 @@ void AnnotationWindow::InitControls() mpOutliner.reset( new ::Outliner(GetAnnotationPool(),OutlinerMode::TextObject) ); SdDrawDocument::SetCalcFieldValueHdl( mpOutliner.get() ); - mpOutliner->SetUpdateMode( true ); + mpOutliner->SetUpdateLayout( true ); if (OutputDevice* pDev = mpDoc->GetRefDevice()) mpOutliner->SetRefDevice( pDev ); diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 661b0cb69452..98c346bc8b85 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -123,7 +123,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark ) // prevent flickering pOV->HideCursor(); - pOL->SetUpdateMode(false); + pOL->SetUpdateLayout(false); // remove old selected text pOV->InsertText( "" ); @@ -145,7 +145,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark ) rUndoMgr.LeaveListAction(); // restart repainting - pOL->SetUpdateMode(true); + pOL->SetUpdateLayout(true); pOV->ShowCursor(); } @@ -230,7 +230,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) // prevent flicker pOV->HideCursor(); - pOL->SetUpdateMode(false); + pOL->SetUpdateLayout(false); /* remember old attributes: To do that, remove selected area before (it has to go anyway). ... etc. - the rest is truncated