svx/source/svdraw/svdoashp.cxx | 3 ++- svx/source/svdraw/svdotext.cxx | 2 +- svx/source/svdraw/svdotxat.cxx | 2 +- svx/source/svdraw/svdotxed.cxx | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-)
New commits: commit feb3c03b70ac1534a187e390c3bc1604a919ce12 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Fri Mar 21 15:28:21 2025 -0400 Commit: Justin Luth <justin.l...@collabora.com> CommitDate: Tue Mar 25 21:43:49 2025 +0100 related tdf#165521 svx: avoid FormatFullDoc, SetFixedCellHeight first This ought to be an optimization. Typically the outliner is empty before SetText. In that case there is nothing to reformat, and since a change in FixedCellHeight triggers an expensive FormatFullDoc (if IsFormatted) do it before SetText to avoid formatting the text twice. Change-Id: Ib7a72f863a16ecc4c491df1659d743697cdaaabd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183272 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 51a2fc58b98a..63a11924ece1 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2350,8 +2350,9 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(tools::Rectangle& rR, bool OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); if( pOutlinerParaObject != nullptr ) { + rOutliner.SetFixedCellHeight( + GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); rOutliner.SetText(*pOutlinerParaObject); - rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); } if ( bWdtGrow ) { diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index d0ac761a205e..0736ec75267b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -783,8 +783,8 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRe { if( bHitTest ) // #i33696# take back fix #i27510# { - rOutliner.SetTextObj( this ); rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); + rOutliner.SetTextObj( this ); } rOutliner.SetUpdateLayout(true); diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index b6029f92afa4..7f4e321cf62a 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -149,8 +149,8 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight( tools::Rectangle& rR, bool bHgt, OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); if (pOutlinerParaObject) { - rOutliner.SetText(*pOutlinerParaObject); rOutliner.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); + rOutliner.SetText(*pOutlinerParaObject); } if (bWdtGrow) diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 32fb9111a47e..f8cb7c8f125a 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -75,8 +75,8 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); if(pOutlinerParaObject!=nullptr) { - rOutl.SetText(*GetOutlinerParaObject()); rOutl.SetFixedCellHeight(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT).GetValue()); + rOutl.SetText(*GetOutlinerParaObject()); } // if necessary, set frame attributes for the first (new) paragraph of the