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:58:15 +0200
commit0ceddcdff4a7a5d18f1ef5e6865a5f85a8553e6d (patch)
tree301a8de07523e5c4430a63959bbadafae85e960d /svx
parent0cfac0def1ec3835df63a698291b9dd0ec4a0ec2 (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/+/150329 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 5dbc1ee1a8e5..ed062d5d7218 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