summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-04-13 21:26:43 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-04-17 12:52:04 +0200
commitaaa077ccf4600f582cd33b7510f0d911bf5845d6 (patch)
treebdd11f904b7eafbdca6f2c30f2c3650b48f2fbee /svx
parent7583dbe23f7620d23328db4a9c9cdd4b0d24df7d (diff)
tdf#154501 - Fileopen PPTX: Table with rotated text wrong
regression from commit eec42f0dbcc79a4c9f456ce97fa1066b8031ea28 Author: Noel Grandin <noelgrandin@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.grandin@collabora.co.uk> (cherry picked from commit ad97694737c99889bc0eb21efccb83768d510361) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150330 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/cell.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 27c928eb20f3..ba335ca27388 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -308,14 +308,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);
}
}
@@ -324,22 +323,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