svx/source/table/cell.cxx |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

New commits:
commit ad97694737c99889bc0eb21efccb83768d510361
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Apr 13 21:26:43 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Apr 14 07:53:23 2023 +0200

    tdf#154501 - Fileopen PPTX: Table with rotated text wrong
    
    regression from
    
        commit eec42f0dbcc79a4c9f456ce97fa1066b8031ea28
        Author: Noel Grandin <noelgran...@gmail.com>
        Date:   Sun Aug 15 17:35:58 2021 +0200
        pass OutlinerParaObject around by value
    
    where some of code I converted needed to be mutating the
    OutlinerParaObject that something else held, rather than mutating
    a local copy.
    
    Change-Id: Ib91dddb3fc0d4190868f9fd59becb0d366af5e19
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150376
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index c39ac6ae7afd..97490977a50e 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -309,14 +309,13 @@ namespace sdr::properties
                 rObj.SetVerticalWriting(bVertical);
 
                 // Set a cell vertical property
-                std::optional<OutlinerParaObject> pParaObj = 
mxCell->CreateEditOutlinerParaObject();
-
-                if( !pParaObj && mxCell->GetOutlinerParaObject() )
-                    pParaObj = *mxCell->GetOutlinerParaObject();
+                std::optional<OutlinerParaObject> pEditParaObj = 
mxCell->CreateEditOutlinerParaObject();
 
-                if(pParaObj)
+                if( !pEditParaObj && mxCell->GetOutlinerParaObject() )
                 {
-                    pParaObj->SetVertical(bVertical);
+                    OutlinerParaObject* pParaObj = 
mxCell->GetOutlinerParaObject();
+                    if(pParaObj)
+                        pParaObj->SetVertical(bVertical);
                 }
             }
 
@@ -325,22 +324,23 @@ namespace sdr::properties
                 const SvxTextRotateItem* pRotateItem = static_cast<const 
SvxTextRotateItem*>(pNewItem);
 
                 // Set a cell vertical property
-                std::optional<OutlinerParaObject> pParaObj = 
mxCell->CreateEditOutlinerParaObject();
+                std::optional<OutlinerParaObject> pEditParaObj = 
mxCell->CreateEditOutlinerParaObject();
 
-                if (!pParaObj && mxCell->GetOutlinerParaObject())
-                    pParaObj = *mxCell->GetOutlinerParaObject();
-
-                if (pParaObj)
+                if (!pEditParaObj && mxCell->GetOutlinerParaObject())
                 {
-                    if(pRotateItem->IsVertical() && 
pRotateItem->IsTopToBottom())
-                        pParaObj->SetRotation(TextRotation::TOPTOBOTTOM);
-                    else if (pRotateItem->IsVertical())
-                        pParaObj->SetRotation(TextRotation::BOTTOMTOTOP);
-                    else
-                        pParaObj->SetRotation(TextRotation::NONE);
+                    OutlinerParaObject* pParaObj = 
mxCell->GetOutlinerParaObject();
+                    if (pParaObj)
+                    {
+                        if(pRotateItem->IsVertical() && 
pRotateItem->IsTopToBottom())
+                            pParaObj->SetRotation(TextRotation::TOPTOBOTTOM);
+                        else if (pRotateItem->IsVertical())
+                            pParaObj->SetRotation(TextRotation::BOTTOMTOTOP);
+                        else
+                            pParaObj->SetRotation(TextRotation::NONE);
+                    }
                 }
 
-               // Change autogrow direction
+                // Change autogrow direction
                 SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
 
                 // rescue object size

Reply via email to