diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-09-01 18:26:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-09-02 19:08:49 +0200 |
commit | c1c679deca078209bc3008ccd9ccc0a8715929a1 (patch) | |
tree | 6f5a1a1207636b4b7f1b0575f36cbf579f7c85af | |
parent | 58da51715425d781b5b8b9b9e412c98daf80b601 (diff) |
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.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
80 files changed, 345 insertions, 396 deletions
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). @@ -272,7 +272,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) rUndoMgr.LeaveListAction(); // show it again - pOL->SetUpdateMode(true); + pOL->SetUpdateLayout(true); pOV->ShowCursor(); } diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index 7b499db91786..73c574395b74 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -88,7 +88,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) return; SdOutliner aOutliner( mpDoc, OutlinerMode::OutlineObject ); - aOutliner.SetUpdateMode(false); + aOutliner.SetUpdateLayout(false); aOutliner.EnableUndo(false); if (mpDocSh) diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx index 8122b43fe67b..522c30897dc7 100644 --- a/sd/source/ui/func/fusumry.cxx +++ b/sd/source/ui/func/fusumry.cxx @@ -160,7 +160,7 @@ void FuSummaryPage::DoExecute( SfxRequest& ) pNotesPage->setHeaderFooterSettings(pActualNotesPage->getHeaderFooterSettings()); pOutl.reset(new SdOutliner( mpDoc, OutlinerMode::OutlineObject )); - pOutl->SetUpdateMode(false); + pOutl->SetUpdateLayout(false); pOutl->EnableUndo(false); if (mpDocSh) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 38989bd61c2a..feeb2c1b7b00 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1121,12 +1121,12 @@ namespace { const ::tools::Rectangle aOutRect (rPrinter.GetPageOffset(), rPrinter.GetOutputSize()); Outliner* pOutliner = rDocument.GetInternalOutliner(); const OutlinerMode nSavedOutlMode (pOutliner->GetOutlinerMode()); - const bool bSavedUpdateMode (pOutliner->GetUpdateMode()); + const bool bSavedUpdateMode (pOutliner->IsUpdateLayout()); const Size aSavedPaperSize (pOutliner->GetPaperSize()); pOutliner->Init(OutlinerMode::OutlineView); pOutliner->SetPaperSize(aOutRect.GetSize()); - pOutliner->SetUpdateMode(true); + pOutliner->SetUpdateLayout(true); pOutliner->Clear(); pOutliner->SetText(*mpParaObject); @@ -1139,7 +1139,7 @@ namespace { // Restore outliner and printer. pOutliner->Clear(); - pOutliner->SetUpdateMode(bSavedUpdateMode); + pOutliner->SetUpdateLayout(bSavedUpdateMode); pOutliner->SetPaperSize(aSavedPaperSize); pOutliner->Init(nSavedOutlMode); } @@ -1626,11 +1626,11 @@ private: Outliner* pOutliner = mrBase.GetDocument()->GetInternalOutliner(); pOutliner->Init(OutlinerMode::OutlineView); const OutlinerMode nSavedOutlMode (pOutliner->GetOutlinerMode()); - const bool bSavedUpdateMode (pOutliner->GetUpdateMode()); + const bool bSavedUpdateMode (pOutliner->IsUpdateLayout()); const Size aSavedPaperSize (pOutliner->GetPaperSize()); const MapMode aSavedMapMode (pOutliner->GetRefMapMode()); pOutliner->SetPaperSize(aOutRect.GetSize()); - pOutliner->SetUpdateMode(true); + pOutliner->SetUpdateLayout(true); ::tools::Long nPageH = aOutRect.GetHeight(); @@ -1751,7 +1751,7 @@ private: } pOutliner->SetRefMapMode(aSavedMapMode); - pOutliner->SetUpdateMode(bSavedUpdateMode); + pOutliner->SetUpdateLayout(bSavedUpdateMode); pOutliner->SetPaperSize(aSavedPaperSize); pOutliner->Init(nSavedOutlMode); } diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 16e86f239d83..de86a8695605 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -315,7 +315,7 @@ void SdOutliner::EndSpelling() mpImpl->ReleaseOutlinerView(); } - SetUpdateMode(true); + SetUpdateLayout(true); } // Before clearing the modify flag use it as a hint that @@ -965,7 +965,7 @@ void SdOutliner::DetectChange() if (pPageView != nullptr) mpView->UnmarkAllObj (pPageView); mpView->SdrEndTextEdit(); - SetUpdateMode(false); + SetUpdateLayout(false); OutlinerView* pOutlinerView = getOutlinerView(); if (pOutlinerView != nullptr) pOutlinerView->SetOutputArea( ::tools::Rectangle( Point(), Size(1, 1) ) ); @@ -1187,7 +1187,7 @@ void SdOutliner::ProvideNextTextObject() { DBG_UNHANDLED_EXCEPTION("sd.view"); } - SetUpdateMode(false); + SetUpdateLayout(false); OutlinerView* pOutlinerView = getOutlinerView(); if (pOutlinerView != nullptr) pOutlinerView->SetOutputArea( ::tools::Rectangle( Point(), Size(1, 1) ) ); @@ -1642,7 +1642,7 @@ void SdOutliner::EnterEditMode (bool bGrabFocus) mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, pOutlinerView, true, true, bGrabFocus); - SetUpdateMode(true); + SetUpdateLayout(true); mbFoundObject = true; } @@ -1804,10 +1804,10 @@ void SdOutliner::StartConversion( LanguageType nSourceLanguage, LanguageType nT */ void SdOutliner::PrepareConversion() { - SetUpdateMode(true); + SetUpdateLayout(true); if( HasConvertibleTextPortion( mnConversionLanguage ) ) { - SetUpdateMode(false); + SetUpdateLayout(false); mbStringFound = true; mbMatchMayExist = true; @@ -1819,7 +1819,7 @@ void SdOutliner::PrepareConversion() } else { - SetUpdateMode(false); + SetUpdateLayout(false); } } @@ -1996,7 +1996,7 @@ void SdOutliner::Implementation::ProvideOutlinerView ( if (bInsert) rOutliner.InsertView( mpOutlineView ); - rOutliner.SetUpdateMode(false); + rOutliner.SetUpdateLayout(false); mpOutlineView->SetOutputArea (::tools::Rectangle (Point(), Size(1, 1))); rOutliner.SetPaperSize( Size(1, 1) ); rOutliner.SetText(OUString(), rOutliner.GetParagraph(0)); diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 10cd6db42f6f..abde4954e3f9 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -181,7 +181,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, OutlinerView* pOV = GetTextEditOutlinerView(); ::Outliner* pOutliner = pOV->GetOutliner(); - pOutliner->SetUpdateMode(false); + pOutliner->SetUpdateLayout(false); mpDocSh->SetWaitCursor( true ); // replace placeholder by template name @@ -256,7 +256,7 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet, } mpDocSh->SetWaitCursor( false ); - pOV->GetOutliner()->SetUpdateMode(true); + pOV->GetOutliner()->SetUpdateLayout(true); mpDocSh->GetUndoManager()->LeaveListAction(); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 5a1a75e4670c..10ad17751f65 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -509,9 +509,9 @@ public: // Calculate to outliner text size pOutliner->UpdateFields(); - pOutliner->SetUpdateMode(true); + pOutliner->SetUpdateLayout(true); Size aTextSize(pOutliner->CalcTextSize()); - pOutliner->SetUpdateMode(false); + pOutliner->SetUpdateLayout(false); // Create objects, apply the outliner and add them (objects) to all master pages const sal_uInt16 nCount = m_rDrawViewShell.GetDoc()->GetMasterSdPageCount(PageKind::Standard); @@ -2498,10 +2498,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) pRectObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(true)); pOutl->UpdateFields(); - pOutl->SetUpdateMode( true ); + pOutl->SetUpdateLayout( true ); Size aSize( pOutl->CalcTextSize() ); aSize.setWidth( aSize.Width() * nMul ); - pOutl->SetUpdateMode( false ); + pOutl->SetUpdateLayout( false ); Point aPos; ::tools::Rectangle aRect( aPos, GetActiveWindow()->GetOutputSizePixel() ); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index b1016470bc42..dd9d8bb20620 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1496,9 +1496,9 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText, OBJ_TEXT); pOutl->UpdateFields(); - pOutl->SetUpdateMode( true ); + pOutl->SetUpdateLayout( true ); Size aSize(pOutl->CalcTextSize()); - pOutl->SetUpdateMode( false ); + pOutl->SetUpdateLayout( false ); Point aPos; ::tools::Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() ); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index f4d1b15d7888..accd57ec4d22 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -147,7 +147,7 @@ void OutlineViewShell::Construct() ReadFrameViewData(mpFrameView); ::Outliner& rOutl = pOlView->GetOutliner(); - rOutl.SetUpdateMode(true); + rOutl.SetUpdateLayout(true); if (!bModified) { diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index eae262aa26a7..13501f4f6553 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -99,7 +99,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie mpOutlinerViews[0].reset( new OutlinerView(&mrOutliner, pWindow) ); mpOutlinerViews[0]->SetOutputArea(::tools::Rectangle()); - mrOutliner.SetUpdateMode(false); + mrOutliner.SetUpdateLayout(false); mrOutliner.InsertView(mpOutlinerViews[0].get(), EE_APPEND); onUpdateStyleSettings( true ); @@ -152,7 +152,7 @@ OutlineView::~OutlineView() // uninitialize Outliner: enable color display ResetLinks(); EEControlBits nCntrl = mrOutliner.GetControlWord(); - mrOutliner.SetUpdateMode(false); // otherwise there will be drawn on SetControlWord + mrOutliner.SetUpdateLayout(false); // otherwise there will be drawn on SetControlWord mrOutliner.SetControlWord(nCntrl & ~EEControlBits::NOCOLORS); SvtAccessibilityOptions aOptions; mrOutliner.ForceAutoColor( aOptions.GetIsAutomaticFontColor() ); @@ -1003,7 +1003,7 @@ void OutlineView::FillOutliner() mrOutliner.GetUndoManager().Clear(); mrOutliner.EnableUndo(false); ResetLinks(); - mrOutliner.SetUpdateMode(false); + mrOutliner.SetUpdateLayout(false); Paragraph* pTitleToSelect = nullptr; sal_uInt16 nPageCount = mrDoc.GetSdPageCount(PageKind::Standard); @@ -1098,7 +1098,7 @@ void OutlineView::FillOutliner() mrOutliner.EnableUndo(true); - mrOutliner.SetUpdateMode(true); + mrOutliner.SetUpdateLayout(true); } /** diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index ba1b2cc226d7..950a2422c599 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -289,9 +289,7 @@ void View::DoPaste (::sd::Window* pWindow) // remove all hard linebreaks from the title if (pOutliner->GetParagraphCount() > 1) { - bool bOldUpdateMode = pOutliner->GetUpdateMode(); - - pOutliner->SetUpdateMode( false ); + bool bOldUpdateMode = pOutliner->SetUpdateLayout( false ); const EditEngine& rEdit = pOutliner->GetEditEngine(); const sal_Int32 nParaCount = rEdit.GetParagraphCount(); @@ -304,7 +302,7 @@ void View::DoPaste (::sd::Window* pWindow) } DBG_ASSERT( rEdit.GetParagraphCount() <= 1, "Titleobject contains hard line breaks" ); - pOutliner->SetUpdateMode(bOldUpdateMode); + pOutliner->SetUpdateLayout(bOldUpdateMode); } } diff --git a/starmath/source/smediteng.cxx b/starmath/source/smediteng.cxx index 7379c705f190..c7b33373bc4d 100644 --- a/starmath/source/smediteng.cxx +++ b/starmath/source/smediteng.cxx @@ -67,7 +67,7 @@ void SmEditEngine::executeZoom(EditView* pEditView) updateZoom(); if (pEditView) { - FormatAndUpdate(pEditView); + FormatAndLayout(pEditView); pEditView->SetSelection(pEditView->GetSelection()); } } diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx index 0e31a3780e3e..8a7a9f58c225 100644 --- a/svx/source/dialog/weldeditview.cxx +++ b/svx/source/dialog/weldeditview.cxx @@ -910,7 +910,7 @@ IMPL_LINK(WeldTextForwarder, NotifyHdl, EENotify&, rNotify, void) if (EditEngine* pEditEngine = m_rEditAcc.GetEditEngine()) { if (rNotify.eNotificationType == EE_NOTIFY_PROCESSNOTIFICATIONS - && !pEditEngine->GetUpdateMode()) + && !pEditEngine->IsUpdateLayout()) { // tdf#143088 an UpdateMode of false will just to on to cause // AccessibleTextHelper_Impl::GetTextForwarder to throw an @@ -1055,7 +1055,7 @@ bool WeldTextForwarder::IsValid() const EditEngine* pEditEngine = m_rEditAcc.GetEditEngine(); // cannot reliably query EditEngine state // while in the middle of an update - return pEditEngine && pEditEngine->GetUpdateMode(); + return pEditEngine && pEditEngine->IsUpdateLayout(); } OUString WeldTextForwarder::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index f31dd910aa78..eda65d12ba19 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -290,7 +290,7 @@ void SdrObjEditView::ModelHasChanged() { aTextEditArea = aEditArea1; aMinTextEditArea = aMinArea1; - pTextEditOutliner->SetUpdateMode(false); + pTextEditOutliner->SetUpdateLayout(false); pTextEditOutliner->SetMinAutoPaperSize(aPaperMin1); pTextEditOutliner->SetMaxAutoPaperSize(aPaperMax1); pTextEditOutliner->SetPaperSize(Size(0, 0)); // re-format Outliner @@ -323,7 +323,7 @@ void SdrObjEditView::ModelHasChanged() if (nStat != nStat0) pOLV->SetControlWord(nStat); } - pTextEditOutliner->SetUpdateMode(true); + pTextEditOutliner->SetUpdateLayout(true); bAreaChg = true; } } @@ -759,7 +759,7 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const tools:: if (!comphelper::LibreOfficeKit::isActive() || !rRect.IsEmpty()) aBlankRect.Intersection(rRect); - rOutlView.GetOutliner()->SetUpdateMode(true); // Bugfix #22596# + rOutlView.GetOutliner()->SetUpdateLayout(true); // Bugfix #22596# rOutlView.Paint(aBlankRect, &rTargetDevice); if (!bModified) @@ -858,7 +858,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie bool bContourFrame = pText != nullptr && pText->IsContourTextFrame(); // create OutlinerView OutlinerView* pOutlView = pGivenView; - pTextEditOutliner->SetUpdateMode(false); + pTextEditOutliner->SetUpdateLayout(false); if (pOutlView == nullptr) { @@ -898,7 +898,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } // do update before setting output area so that aTextEditArea can be recalculated - pTextEditOutliner->SetUpdateMode(true); + pTextEditOutliner->SetUpdateLayout(true); pOutlView->SetOutputArea(aTextEditArea); ImpInvalidateOutlinerView(*pOutlView); return pOutlView; diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index a6f4aeed9ec0..5cd3e37dec4c 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -671,7 +671,7 @@ void SdrModel::ImpSetOutlinerDefaults( SdrOutliner* pOutliner, bool bInit ) if( bInit ) { pOutliner->EraseVirtualDevice(); - pOutliner->SetUpdateMode(false); + pOutliner->SetUpdateLayout(false); pOutliner->SetEditTextObjectPool(m_pItemPool.get()); pOutliner->SetDefTab(m_nDefaultTabulator); } diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index eac980c82981..5cdd00a77e39 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2315,7 +2315,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool { Outliner& rOutliner=ImpGetDrawOutliner(); rOutliner.SetPaperSize(aSiz); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); // TODO: add the optimization with bPortionInfoChecked again. OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); if( pOutlinerParaObject != nullptr ) @@ -2680,7 +2680,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& if( bHitTest ) rOutliner.SetTextObj( this ); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(*pPara); } } @@ -2689,7 +2689,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rOutliner.SetTextObj( nullptr ); } - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetControlWord(nStat0); SdrText* pText = getActiveText(); diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index b8e411f7c43e..6c2c4b1860b8 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -602,7 +602,7 @@ void SdrMeasureObj::UndirtyText() const rOutliner.SetText(*pOutlinerParaObject); } - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.UpdateFields(); Size aSiz(rOutliner.CalcTextSize()); rOutliner.Clear(); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 32541331fca0..3ad373cad189 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -222,7 +222,7 @@ void SdrTextObj::FitFrameToTextSize() SdrOutliner& rOutliner=ImpGetDrawOutliner(); rOutliner.SetPaperSize(Size(maRect.Right()-maRect.Left(),maRect.Bottom()-maRect.Top())); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(*pText->GetOutlinerParaObject()); Size aNewSize(rOutliner.CalcTextSize()); rOutliner.Clear(); @@ -262,7 +262,7 @@ void SdrTextObj::NbcSetText(SvStream& rInput, const OUString& rBaseURL, EETextFo rOutliner.SetStyleSheet( 0, GetStyleSheet()); rOutliner.Read(rInput,rBaseURL,eFormat); std::optional<OutlinerParaObject> pNewText=rOutliner.CreateParaObject(); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); Size aSize(rOutliner.CalcTextSize()); rOutliner.Clear(); NbcSetOutlinerParaObject(std::move(pNewText)); @@ -289,7 +289,7 @@ const Size& SdrTextObj::GetTextSize() const { SdrOutliner& rOutliner=ImpGetDrawOutliner(); rOutliner.SetText(*pText->GetOutlinerParaObject()); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); aSiz=rOutliner.CalcTextSize(); rOutliner.Clear(); } @@ -789,7 +789,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(*pPara); } } @@ -798,7 +798,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe rOutliner.SetTextObj( nullptr ); } - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetControlWord(nStat0); if( pText ) @@ -1144,7 +1144,7 @@ Point SdrTextObj::GetSnapPoint(sal_uInt32 i) const // Extracted from ImpGetDrawOutliner() void SdrTextObj::ImpInitDrawOutliner( SdrOutliner& rOutl ) const { - rOutl.SetUpdateMode(false); + rOutl.SetUpdateLayout(false); OutlinerMode nOutlinerMode = OutlinerMode::OutlineObject; if ( !IsOutlText() ) nOutlinerMode = OutlinerMode::TextObject; diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index a1e885c0e009..5d8312beeefe 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -692,7 +692,7 @@ void SdrTextObj::impDecomposeContourTextPrimitive( const Size aNullSize; rOutliner.SetPaperSize(aNullSize); rOutliner.SetPolygon(aPolyPolygon); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(rSdrContourTextPrimitive.getOutlinerParaObject()); // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition @@ -780,7 +780,7 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( } rOutliner.SetPaperSize(aNullSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(*pOutlinerParaObject); ImpAutoFitText(rOutliner,aAnchorTextSize,bVerticalWriting); @@ -972,7 +972,7 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( } rOutliner.SetPaperSize(aAnchorTextSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject()); } else @@ -1029,7 +1029,7 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( } rOutliner.SetPaperSize(aNullSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(rSdrBlockTextPrimitive.getOutlinerParaObject()); } @@ -1179,7 +1179,7 @@ void SdrTextObj::impDecomposeStretchTextPrimitive( rOutliner.SetMinAutoPaperSize(aNullSize); rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000)); rOutliner.SetPaperSize(aNullSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(rSdrStretchTextPrimitive.getOutlinerParaObject()); // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition @@ -1512,7 +1512,7 @@ void SdrTextObj::impHandleChainingEventsDuringDecomposition(SdrOutliner &rOutlin // Initialize Chaining Outliner SdrOutliner &rChainingOutl(getSdrModelFromSdrObject().GetChainingOutliner(this)); ImpInitDrawOutliner( rChainingOutl ); - rChainingOutl.SetUpdateMode(true); + rChainingOutl.SetUpdateLayout(true); // We must pass the chaining outliner otherwise we would mess up decomposition aTxtChainFlow.ExecuteOverflow(&rOutliner, &rChainingOutl); } @@ -1579,7 +1579,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive( } rOutliner.SetPaperSize(aNullSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); // Sets original text rOutliner.SetText(*pOutlinerParaObject); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index d97d9129124b..83b5c6525419 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -657,7 +657,7 @@ void SdrTextObj::impDecomposePathTextPrimitive( // prepare outliner SdrOutliner& rOutliner = ImpGetDrawOutliner(); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.Clear(); rOutliner.SetPaperSize(Size(LONG_MAX,LONG_MAX)); rOutliner.SetText(rSdrPathTextPrimitive.getOutlinerParaObject()); diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index ef4184448507..2dc96ce1e0b2 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -143,7 +143,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, { Outliner& rOutliner = ImpGetDrawOutliner(); rOutliner.SetPaperSize(aNewSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); // TODO: add the optimization with bPortionInfoChecked etc. here OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); if (pOutlinerParaObject) diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 8642332a49a2..bbcdc2a7add9 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -339,8 +339,7 @@ void SdrTextObj::ImpSetTextEditParams() const if (mpEditingOutliner==nullptr) return; - bool bUpdBuf=mpEditingOutliner->GetUpdateMode(); - if (bUpdBuf) mpEditingOutliner->SetUpdateMode(false); + bool bUpdBuf=mpEditingOutliner->SetUpdateLayout(false); Size aPaperMin; Size aPaperMax; tools::Rectangle aEditArea; @@ -355,7 +354,7 @@ void SdrTextObj::ImpSetTextEditParams() const TakeTextAnchorRect(aAnchorRect); ImpSetContourPolygon(*mpEditingOutliner,aAnchorRect, true); } - if (bUpdBuf) mpEditingOutliner->SetUpdateMode(true); + if (bUpdBuf) mpEditingOutliner->SetUpdateLayout(true); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx index 738309182fd7..f13129a6d798 100644 --- a/svx/source/svdraw/svdoutl.cxx +++ b/svx/source/svdraw/svdoutl.cxx @@ -41,7 +41,7 @@ void SdrOutliner::SetTextObj( const SdrTextObj* pObj ) { if( pObj && pObj != mpTextObj.get() ) { - SetUpdateMode(false); + SetUpdateLayout(false); OutlinerMode nOutlinerMode2 = OutlinerMode::OutlineObject; if ( !pObj->IsOutlText() ) nOutlinerMode2 = OutlinerMode::TextObject; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 2c4a7c84f2b2..9763ea5015cb 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -65,13 +65,13 @@ void TextChainFlow::impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) */ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *pParamOutl) { - bool bOldUpdateMode = pFlowOutl->GetUpdateMode(); + bool bOldUpdateMode = pFlowOutl->IsUpdateLayout(); // XXX: This could be reorganized moving most of this stuff inside EditingTextChainFlow if (pParamOutl != nullptr) { // We need this since it's required to check overflow - pFlowOutl->SetUpdateMode(true); + pFlowOutl->SetUpdateLayout(true); // XXX: does this work if you do it before setting the text? Seems so. impSetFlowOutlinerParams(pFlowOutl, pParamOutl); @@ -103,7 +103,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p // Reset update mode // Reset it here because we use WriteRTF (needing updatemode = true) in the two constructors above if (!bOldUpdateMode) // Reset only if the old value was false - pFlowOutl->SetUpdateMode(bOldUpdateMode); + pFlowOutl->SetUpdateLayout(bOldUpdateMode); // NOTE: Must be called after mp*ChText abd b*flow have been set but before mbOFisUFinduced is reset impUpdateCursorInfo(); diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 52c6f7ebe3d2..1b1d74a52516 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -458,7 +458,7 @@ void Cell::mergeContent( const CellRef& xSourceCell ) return; SdrOutliner& rOutliner=rTableObj.ImpGetDrawOutliner(); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); if( hasText() ) { @@ -700,7 +700,7 @@ sal_Int32 Cell::calcPreferredWidth( const Size aSize ) Outliner& rOutliner=static_cast< SdrTableObj& >( GetObject() ).ImpGetDrawOutliner(); rOutliner.SetPaperSize(aSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); ForceOutlinerParaObject( OutlinerMode::TextObject ); if( GetOutlinerParaObject() ) @@ -741,7 +741,7 @@ sal_Int32 Cell::getMinimumHeight() { Outliner& rOutliner=rTableObj.ImpGetDrawOutliner(); rOutliner.SetPaperSize(aSize); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); ForceOutlinerParaObject( OutlinerMode::TextObject ); if( GetOutlinerParaObject() ) diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index ab353e0a1ec4..28ad30df44b9 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1539,7 +1539,7 @@ void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, too if( bHitTest ) // #i33696# take back fix #i27510# rOutliner.SetTextObj( this ); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText(*pPara); } } @@ -1548,7 +1548,7 @@ void SdrTableObj::TakeTextRect( const CellPos& rPos, SdrOutliner& rOutliner, too rOutliner.SetTextObj( nullptr ); } - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetControlWord(nStat0); Point aTextPos(aAnkRect.TopLeft()); @@ -1817,8 +1817,7 @@ bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl) rOutl.Init( OutlinerMode::TextObject ); rOutl.SetRefDevice(getSdrModelFromSdrObject().GetRefDevice()); - bool bUpdateMode=rOutl.GetUpdateMode(); - if (bUpdateMode) rOutl.SetUpdateMode(false); + bool bUpdateMode = rOutl.SetUpdateLayout(false); Size aPaperMin; Size aPaperMax; tools::Rectangle aEditArea; @@ -1828,7 +1827,7 @@ bool SdrTableObj::BegTextEdit(SdrOutliner& rOutl) rOutl.SetMaxAutoPaperSize(aPaperMax); rOutl.SetPaperSize(aPaperMax); - if (bUpdateMode) rOutl.SetUpdateMode(true); + if (bUpdateMode) rOutl.SetUpdateLayout(true); EEControlBits nStat=rOutl.GetControlWord(); nStat |= EEControlBits::AUTOPAGESIZE; diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index f00ca3a159b2..8f6e1c649319 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -154,7 +154,7 @@ SdrTableRTFParser::SdrTableRTFParser( SdrTableObj& rTableObj ) , mpDefMerge( nullptr ) , mxTable( rTableObj.getTable() ) { - mpOutliner->SetUpdateMode(true); + mpOutliner->SetUpdateLayout(true); mpOutliner->SetStyleSheet( 0, mrTableObj.GetStyleSheet() ); mpInsDefault.reset( new RTFCellDefault( &mrItemPool ) ); } @@ -319,7 +319,7 @@ void SdrTableRTFParser::FillTable() if( pTextObject ) { SdrOutliner& rOutliner=mrTableObj.ImpGetDrawOutliner(); - rOutliner.SetUpdateMode(true); + rOutliner.SetUpdateLayout(true); rOutliner.SetText( *pTextObject ); mrTableObj.NbcSetOutlinerParaObjectForText( rOutliner.CreateParaObject(), xCell.get() ); } diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 50c341cab694..e24f7c657bf3 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -502,7 +502,7 @@ SvxTextForwarder* SvxTextEditSourceImpl::GetBackgroundTextForwarder() mpOutliner->SetTextObjNoInit( pTextObj ); if( mbIsLocked ) { - const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->SetUpdateMode( false ); + const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->SetUpdateLayout( false ); mbOldUndoMode = mpOutliner->GetEditEngine().IsUndoEnabled(); const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->EnableUndo( false ); } @@ -798,7 +798,7 @@ void SvxTextEditSourceImpl::lock() mbIsLocked = true; if( mpOutliner ) { - const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->SetUpdateMode( false ); + const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->SetUpdateLayout( false ); mbOldUndoMode = mpOutliner->GetEditEngine().IsUndoEnabled(); const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->EnableUndo( false ); } @@ -816,7 +816,7 @@ void SvxTextEditSourceImpl::unlock() if( mpOutliner ) { - const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->SetUpdateMode( true ); + const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->SetUpdateLayout( true ); const_cast<EditEngine*>(&(mpOutliner->GetEditEngine()))->EnableUndo( mbOldUndoMode ); } } diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx index 3f9758ae8bc0..f7c0d0046b5e 100644 --- a/sw/source/filter/html/htmldrawwriter.cxx +++ b/sw/source/filter/html/htmldrawwriter.cxx @@ -269,7 +269,7 @@ Writer& OutHTML_DrawFrameFormatAsMarquee( Writer& rWrt, // What follows now is the counterpart of SdrTextObject::SetText() Outliner aOutliner(nullptr, OutlinerMode::TextObject); - aOutliner.SetUpdateMode( false ); + aOutliner.SetUpdateLayout( false ); aOutliner.SetText( *pOutlinerParaObj ); OUString aText( aOutliner.GetText( aOutliner.GetParagraph(0), aOutliner.GetParagraphCount() ) ); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 19f663f9895c..aeb18ab29fe8 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -316,7 +316,7 @@ void SwAnnotationWin::InitControls() SwDocShell* aShell = mrView.GetDocShell(); mpOutliner.reset(new Outliner(&aShell->GetPool(),OutlinerMode::TextObject)); aShell->GetDoc()->SetCalcFieldValueHdl( mpOutliner.get() ); - mpOutliner->SetUpdateMode( true ); + mpOutliner->SetUpdateLayout( true ); mpOutlinerView.reset(new OutlinerView(mpOutliner.get(), nullptr)); mpOutliner->InsertView(mpOutlinerView.get()); diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx index 939890805425..8106f0b32191 100644 --- a/sw/source/uibase/lingu/sdrhhcwrap.cxx +++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx @@ -81,7 +81,7 @@ SdrHHCWrapper::~SdrHHCWrapper() SdrView *pSdrView = pView->GetWrtShell().GetDrawView(); OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" ); pSdrView->SdrEndTextEdit( true ); - SetUpdateMode(false); + SetUpdateLayout(false); pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1, 1) ) ); } RemoveView( pOutlView.get() ); @@ -102,7 +102,7 @@ bool SdrHHCWrapper::ConvertNextDocument() SdrView *pSdrView = pView->GetWrtShell().GetDrawView(); OSL_ENSURE( pSdrView, "SdrHHCWrapper without DrawView?" ); pSdrView->SdrEndTextEdit( true ); - SetUpdateMode(false); + SetUpdateLayout(false); pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1, 1) ) ); SetPaperSize( Size(1, 1) ); Clear(); @@ -131,7 +131,7 @@ bool SdrHHCWrapper::ConvertNextDocument() //!! work correctly because the document may not be properly //!! formatted when some information is accessed, and thus //!! incorrect results get returned. - SetUpdateMode(true); + SetUpdateLayout(true); if (HasConvertibleTextPortion( nSourceLang )) { SdrView *pSdrView = pView->GetWrtShell().GetDrawView(); @@ -141,13 +141,13 @@ bool SdrHHCWrapper::ConvertNextDocument() bNextDoc = true; pOutlView->SetOutputArea( tools::Rectangle( Point(), Size(1,1))); SetPaperSize( pTextObj->GetLogicRect().GetSize() ); - SetUpdateMode(true); + SetUpdateLayout(true); pView->GetWrtShell().MakeVisible(SwRect(pTextObj->GetLogicRect())); pSdrView->SdrBeginTextEdit(pTextObj, pPV, &pView->GetEditWin(), false, this, pOutlView.get(), true, true); } else - SetUpdateMode(false); + SetUpdateLayout(false); } if ( !bNextDoc ) diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 2ee297ae4095..ad089f373e42 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1769,7 +1769,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) // do not flicker pOLV->HideCursor(); Outliner * pOutliner = pOLV->GetOutliner(); - pOutliner->SetUpdateMode(false); + pOutliner->SetUpdateLayout(false); SfxItemSet aOldSet( pOLV->GetAttribs() ); SfxItemSet aFontSet( @@ -1813,7 +1813,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) pOLV->SetAttribs( aFontSet ); // From now on show it again - pOutliner->SetUpdateMode(true); + pOutliner->SetUpdateLayout(true); pOLV->ShowCursor(); rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) ); diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index d7cdea7018d7..2cb86428b65b 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -732,7 +732,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) // do not flicker pOLV->HideCursor(); SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner(); - pOutliner->SetUpdateMode(false); + pOutliner->SetUpdateLayout(false); SfxItemSet aOldSet( pOLV->GetAttribs() ); SfxItemSet aFontSet( @@ -776,7 +776,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) pOLV->SetAttribs( aFontSet ); // From now on show again - pOutliner->SetUpdateMode(true); + pOutliner->SetUpdateLayout(true); pOLV->ShowCursor(); rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) ); |