sw/source/core/text/pormulti.cxx |   19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 14f019827d73178b3bdf166c642720f49314a514
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Oct 27 20:07:51 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Nov 1 19:39:24 2022 +0100

    tdf#151736 writer direct formatting crash
    
    regression from
        commit 9a44807ff3a11afa8f7ce9857ae6a6144a61d481
        Author: Noel Grandin <noel.gran...@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.gran...@collabora.co.uk>
    (cherry picked from commit 7d63176bcfbc80fc4045a0f0580c5bf9ccea7a89)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141928
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 3fb6a3091ad0..518294e12d9b 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;
+                }
             }
         }
     }

Reply via email to