svx/source/svdraw/svdotextdecomposition.cxx |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

New commits:
commit d10117c9feb6b5c31370b9b474fea7569b98e9cb
Author:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
AuthorDate: Wed Feb 12 14:35:49 2025 +0100
Commit:     Armin Le Grand <armin.le.gr...@me.com>
CommitDate: Wed Feb 12 16:06:56 2025 +0100

    IASS: Use correct OutlinerParaObject in text decompositions
    
    In SdrTextObj the methods impDecomposeAutoFitTextPrimitive and
    impDecomposeChainedTextPrimitive used the wrong
    OutlinerParaObject. Unfortunately there are two OPOs available
    in the SdrTextPrimitive2D, one by using
        (A) getOutlinerParaObject()
    and one using
        (B) getSdrText()->GetOutlinerParaObject()
    whereby (A) is the one which contains possible changes from
    an active text edit while (B) contains the original text at
    the start of the possible text edit.
    By using (B) those two decomposes were not able to show
    the already changed text, thus the update in the SlideShow
    seemed not to work.
    
    Change-Id: Id2dcc3924fe8029688d0e76ca0f3f7300f461bd5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181490
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <armin.le.gr...@me.com>

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index be386f0be223..10975edd9c0f 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -962,10 +962,9 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive(
     // add one to range sizes to get back to the old Rectangle and outliner 
measurements
     const sal_uInt32 
nAnchorTextWidth(basegfx::fround<sal_uInt32>(aAnchorTextRange.getWidth() + 1));
     const sal_uInt32 
nAnchorTextHeight(basegfx::fround<sal_uInt32>(aAnchorTextRange.getHeight() + 
1));
-    const OutlinerParaObject* pOutlinerParaObject = 
rSdrAutofitTextPrimitive.getSdrText()->GetOutlinerParaObject();
-    OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with 
no OutlinerParaObject (!)");
-    const bool bVerticalWriting(pOutlinerParaObject->IsEffectivelyVertical());
-    const bool bTopToBottom(pOutlinerParaObject->IsTopToBottom());
+    const OutlinerParaObject& 
rOutlinerParaObject(rSdrAutofitTextPrimitive.getOutlinerParaObject());
+    const bool bVerticalWriting(rOutlinerParaObject.IsEffectivelyVertical());
+    const bool bTopToBottom(rOutlinerParaObject.IsTopToBottom());
     const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
 
     if(rSdrAutofitTextPrimitive.getWordWrap() || IsTextFrame())
@@ -987,7 +986,7 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive(
 
     rOutliner.SetPaperSize(aAnchorTextSize);
     rOutliner.SetUpdateLayout(true);
-    rOutliner.SetText(*pOutlinerParaObject);
+    rOutliner.SetText(rOutlinerParaObject);
 
     setupAutoFitText(rOutliner, aAnchorTextSize);
     // set visualizing page at Outliner; needed e.g. for PageNumberField 
decomposition
@@ -1788,11 +1787,9 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
     const sal_uInt32 
nAnchorTextHeight(basegfx::fround<sal_uInt32>(aAnchorTextRange.getHeight() + 
1));
 
     // Text
-    const OutlinerParaObject* pOutlinerParaObject = 
rSdrChainedTextPrimitive.getSdrText()->GetOutlinerParaObject();
-    OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with 
no OutlinerParaObject (!)");
-
-    const bool bVerticalWriting(pOutlinerParaObject->IsEffectivelyVertical());
-    const bool bTopToBottom(pOutlinerParaObject->IsTopToBottom());
+    const OutlinerParaObject& 
rOutlinerParaObject(rSdrChainedTextPrimitive.getOutlinerParaObject());
+    const bool bVerticalWriting(rOutlinerParaObject.IsEffectivelyVertical());
+    const bool bTopToBottom(rOutlinerParaObject.IsTopToBottom());
     const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
 
     if(IsTextFrame())
@@ -1813,7 +1810,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
     rOutliner.SetPaperSize(aNullSize);
     rOutliner.SetUpdateLayout(true);
     // Sets original text
-    rOutliner.SetText(*pOutlinerParaObject);
+    rOutliner.SetText(rOutlinerParaObject);
 
     /* Begin overflow/underflow handling */
 

Reply via email to