summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit4.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-01 18:26:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-02 19:08:49 +0200
commitc1c679deca078209bc3008ccd9ccc0a8715929a1 (patch)
tree6f5a1a1207636b4b7f1b0575f36cbf579f7c85af /editeng/source/editeng/impedit4.cxx
parent58da51715425d781b5b8b9b9e412c98daf80b601 (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/source/editeng/impedit4.cxx')
-rw-r--r--editeng/source/editeng/impedit4.cxx21
1 files changed, 10 insertions, 11 deletions
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;