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 /editeng | |
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>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editdbg.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 49 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/editview.cxx | 28 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 14 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 11 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 20 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 34 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 21 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 11 | ||||
-rw-r--r-- | editeng/source/outliner/outlin2.cxx | 8 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 44 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 43 | ||||
-rw-r--r-- | editeng/source/uno/unofored.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unoforou.cxx | 2 |
15 files changed, 138 insertions, 155 deletions
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 |