svx/source/table/cell.cxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-)
New commits: commit 0ceddcdff4a7a5d18f1ef5e6865a5f85a8553e6d Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Thu Apr 13 21:26:43 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Apr 17 12:58:15 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> (cherry picked from commit ad97694737c99889bc0eb21efccb83768d510361) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150329 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> 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