summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-05 15:01:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-20 19:20:54 +0200
commite1972743d692c8d8611912c31aae2cb08ae7636d (patch)
tree65817acedf6f17ab8af8df33b2f7abe80fe363d7 /sc
parenteb830ad284f245165b6ab5e8647d48834622f2d5 (diff)
be more disciplined with SetUpdateLayout on editengine
save/restore in more places, and check in more places before doing layout, so we dont waste time on expensive layout Change-Id: I311f1f7f97a508da296078e936cb3704938dfdc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121687 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column2.cxx4
-rw-r--r--sc/source/ui/app/inputwin.cxx4
-rw-r--r--sc/source/ui/view/output2.cxx4
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 658a37b983d4..86460ac576cc 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -376,7 +376,7 @@ tools::Long ScColumn::GetNeededSize(
// save in document ?
std::unique_ptr<ScFieldEditEngine> pEngine = rDocument.CreateFieldEditEngine();
- pEngine->SetUpdateLayout( false );
+ const bool bPrevUpdateLayout = pEngine->SetUpdateLayout( false );
bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER );
EEControlBits nCtrl = pEngine->GetControlWord();
if ( bTextWysiwyg )
@@ -474,7 +474,7 @@ tools::Long ScColumn::GetNeededSize(
bool bEngineVertical = pEngine->IsEffectivelyVertical();
pEngine->SetVertical( bAsianVertical );
- pEngine->SetUpdateLayout( true );
+ pEngine->SetUpdateLayout( bPrevUpdateLayout );
bool bEdWidth = bWidth;
if ( eOrient != SvxCellOrientation::Standard && eOrient != SvxCellOrientation::Stacked )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e7c61fa0dfdc..7296eb15a5cd 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2041,7 +2041,7 @@ void ScTextWnd::MakeDialogEditView()
pNew->SetExecuteURL( false );
m_xEditEngine = std::move(pNew);
- m_xEditEngine->SetUpdateLayout( false );
+ const bool bPrevUpdateLayout = m_xEditEngine->SetUpdateLayout( false );
m_xEditEngine->SetWordDelimiters( m_xEditEngine->GetWordDelimiters() + "=" );
m_xEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) );
@@ -2051,7 +2051,7 @@ void ScTextWnd::MakeDialogEditView()
if ( bIsRTL )
lcl_ModifyRTLDefaults( *pSet );
static_cast<ScEditEngineDefaulter*>(m_xEditEngine.get())->SetDefaults( std::move(pSet) );
- m_xEditEngine->SetUpdateLayout( true );
+ m_xEditEngine->SetUpdateLayout( bPrevUpdateLayout );
m_xEditView = std::make_unique<EditView>(m_xEditEngine.get(), nullptr);
m_xEditView->setEditViewCallbacks(this);
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index c1ac4fa31242..f33098bbb353 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2716,9 +2716,9 @@ bool ScOutputData::DrawEditParam::adjustHorAlignment(ScFieldEditEngine* pEngine)
SvxAdjust eEditAdjust = (meHorJustResult == SvxCellHorJustify::Center) ?
SvxAdjust::Center : SvxAdjust::Right;
- pEngine->SetUpdateLayout(false);
+ const bool bPrevUpdateLayout = pEngine->SetUpdateLayout(false);
pEngine->SetDefaultItem( SvxAdjustItem(eEditAdjust, EE_PARA_JUST) );
- pEngine->SetUpdateLayout(true);
+ pEngine->SetUpdateLayout(bPrevUpdateLayout);
return true;
}
return false;