diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2024-10-18 12:59:17 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2024-10-21 11:42:40 +0200 |
commit | 25d6bd3ebcf4a5d6003288863620565749433787 (patch) | |
tree | eef1a9af31dcef5444c4e5126d37e181181802fb /svx/source | |
parent | ac90d5a823ef95617e79f78dd83571b26f9ff662 (diff) |
Support FixedCellHeight in SdrAutoFitTextPrimitive2D
That was missing with the result that for some cases the
painted text (where it was missing) differed from the
text in EditEngine mode (was set there).
Change-Id: I23ddf8e90be2335c56e5a485308c753dfe72a878
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175127
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 3 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 7 |
3 files changed, 21 insertions, 5 deletions
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index a29d1cbb1900..920b3026ac02 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -679,7 +679,8 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const &rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, - bWordWrap); + bWordWrap, + rText.isFixedCellHeight()); } else if( rText.isChainable() && !rText.isInEditMode() ) { diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 363b5e005ce8..7b3c3a705a5c 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -420,10 +420,12 @@ namespace drawinglayer::primitive2d const SdrText* pSdrText, const OutlinerParaObject& rParaObj, ::basegfx::B2DHomMatrix aTextRangeTransform, - bool bWordWrap) + bool bWordWrap, + bool bFixedCellHeight) : SdrTextPrimitive2D(pSdrText, rParaObj), maTextRangeTransform(std::move(aTextRangeTransform)), - mbWordWrap(bWordWrap) + mbWordWrap(bWordWrap), + mbFixedCellHeight(bFixedCellHeight) { } @@ -434,7 +436,8 @@ namespace drawinglayer::primitive2d const SdrBlockTextPrimitive2D& rCompare = static_cast<const SdrBlockTextPrimitive2D&>(rPrimitive); return (getTextRangeTransform() == rCompare.getTextRangeTransform() - && getWordWrap() == rCompare.getWordWrap()); + && getWordWrap() == rCompare.getWordWrap() + && isFixedCellHeight() == rCompare.isFixedCellHeight()); } return false; @@ -442,7 +445,12 @@ namespace drawinglayer::primitive2d rtl::Reference<SdrTextPrimitive2D> SdrAutoFitTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const { - return new SdrAutoFitTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getWordWrap()); + return new SdrAutoFitTextPrimitive2D( + getSdrText(), + getOutlinerParaObject(), + rTransform * getTextRangeTransform(), + getWordWrap(), + isFixedCellHeight()); } // provide unique ID diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 39e5431a2581..e228471b3433 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -992,6 +992,13 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive( // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage())); + // Do not forget to set FixedCellHeight, else the line heights will not be correct, + // see impDecomposeBlockTextPrimitive or impDecomposeStretchTextPrimitive in this + // file. The visualization for paint and in EditMode would be different. Since + // SetFixedCellHeight *is* used/done in ::BegTextEdit the error is that it is *not* + // done here (in contrast to BlockText and StretchText) + rOutliner.SetFixedCellHeight(rSdrAutofitTextPrimitive.isFixedCellHeight()); + // now get back the layouted text size from outliner const Size aOutlinerTextSize(rOutliner.GetPaperSize()); const basegfx::B2DVector aOutlinerScale(aOutlinerTextSize.Width(), aOutlinerTextSize.Height()); |