diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-27 20:07:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-27 21:03:05 +0200 |
commit | 7d63176bcfbc80fc4045a0f0580c5bf9ccea7a89 (patch) | |
tree | 25bcda6e3bfcd87f09e67903c811b66ae37149de /sw | |
parent | d83a016823dceaeb48f34d4e94f9a230bebd9169 (diff) |
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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/pormulti.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 8ca4b9c625ef..0f00db0d8c26 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; + } } } } |