diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx | 5 | ||||
-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 |
4 files changed, 25 insertions, 6 deletions
diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx index adfcd193b65a..1599f6e08443 100644 --- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx +++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx @@ -270,6 +270,7 @@ namespace drawinglayer::primitive2d ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range bool mbWordWrap : 1; // for CustomShapes text layout + bool mbFixedCellHeight : 1; // local decomposition. virtual Primitive2DReference create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const override; @@ -279,11 +280,13 @@ namespace drawinglayer::primitive2d const SdrText* pSdrText, const OutlinerParaObject& rOutlinerParaObjectPtr, ::basegfx::B2DHomMatrix aTextRangeTransform, - bool bWordWrap); + bool bWordWrap, + bool bFixedCellHeight); // get data const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; } bool getWordWrap() const { return mbWordWrap; } + bool isFixedCellHeight() const { return mbFixedCellHeight; } // compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const override; diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index 2913f19b2548..57aad9519988 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -621,7 +621,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 044058545de4..c7cc6998cbb8 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -993,6 +993,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()); |