tdf#151736 writer direct formatting crash
regression from
commit 9a44807ff3a11afa8f7ce9857ae6a6144a61d481
Author: Noel Grandin <noel.grandin@collabora.co.uk>
Date: Wed Mar 2 17:58:31 2022 +0200
use SfxItemSet::GetItemIfSet in sw/source/core/txt
Change-Id: I9db016d608300c603d0b1386962b188dddc85125
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141943
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 7d63176bcfbc80fc4045a0f0580c5bf9ccea7a89)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141928
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 3fb6a30..518294e 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1040,17 +1040,26 @@ std::optional<SwMultiCreator> SwTextSizeInfo::GetMultiCreator(TextFrameIndex &rP
if (startPos.first->GetIndex() == pNode->GetIndex())
{
iterAtStartOfNode.Assign(iter);
pNodeRotateItem = pNode->GetSwAttrSet().GetItemIfSet(RES_CHRATR_ROTATE);
if (pNodeRotateItem && pNodeRotateItem->GetValue())
if (SfxItemState::SET == pNode->GetSwAttrSet().GetItemState(
RES_CHRATR_ROTATE, true, &pNodeRotateItem) &&
pNodeRotateItem->GetValue())
{
pActiveRotateItem = pNodeRotateItem;
}
pNodeTwoLinesItem = startPos.first->GetSwAttrSet().GetItemIfSet(
RES_CHRATR_TWO_LINES);
if (pNodeTwoLinesItem && pNodeTwoLinesItem->GetValue())
else
{
pNodeRotateItem = nullptr;
}
if (SfxItemState::SET == startPos.first->GetSwAttrSet().GetItemState(
RES_CHRATR_TWO_LINES, true, &pNodeTwoLinesItem) &&
pNodeTwoLinesItem->GetValue())
{
pActiveTwoLinesItem = pNodeTwoLinesItem;
}
else
{
pNodeTwoLinesItem = nullptr;
}
}
}
}