sw/source/core/layout/atrfrm.cxx  |   33 ++++++++++++++++++---------------
 sw/source/core/layout/trvlfrm.cxx |    5 ++++-
 2 files changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 6c50e73334444194c1024f834ca0e0f5ff666d40
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Feb 4 10:27:51 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 4 13:13:15 2024 +0100

    cid#1591494 Dereference null return value
    
    Change-Id: I578093091f70431bd46de55b56b7c1ebab0cd75b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162972
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/layout/trvlfrm.cxx 
b/sw/source/core/layout/trvlfrm.cxx
index 10c4b88e87b9..77ebde80cfe1 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1530,7 +1530,10 @@ Point SwRootFrame::GetNextPrevContentPos( const Point& 
rPoint, bool bNext ) cons
                 if ( pPage )
                     pCnt = pPage->ContainsContent();
                 else
-                    return ContainsContent()->UnionFrame().Pos();
+                {
+                    pCnt = ContainsContent();
+                    return pCnt ? pCnt->UnionFrame().Pos() : Point();
+                }
             }
             pCnt->Calc(pRenderContext);
         }
commit f9dcaeb021bbcad0d152e6be1f4d2719700545ce
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Feb 4 10:22:03 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Feb 4 13:13:03 2024 +0100

    cid#1591496 Dereference null return value
    
    Change-Id: Ic26b910cc9243607641a19ceb2988ed3011939ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162971
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 15d2d309d571..f657aa195066 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2628,22 +2628,25 @@ void SwFrameFormat::SetFormatName( const OUString& 
rNewName, bool bBroadcast )
         }
 
         // update accessibility sidebar object name if we modify the object 
name on the navigator bar
-        if (!aHint.m_sOld.isEmpty() && aHint.m_sOld != aHint.m_sNew)
+        const bool bUpdateA11yName = !aHint.m_sOld.isEmpty() && aHint.m_sOld 
!= aHint.m_sNew;
+        if (!bUpdateA11yName)
+            return;
+        SwFlyFrame* pSFly = SwIterator<SwFlyFrame, SwFormat>(*this).First();
+        if (!pSFly)
+            return;
+        SwFrame *pSFlyLower = pSFly->Lower();
+        if (!pSFlyLower)
+            return;
+        if (!pSFlyLower->IsNoTextFrame())
+        {
+            SwContentFrame* pContent = pSFly->ContainsContent();
+            if (SwTextNode* pSwTxtNode = pContent ? 
static_cast<SwTextFrame*>(pContent)->GetTextNodeFirst() : nullptr)
+                pSwTxtNode->resetAndQueueAccessibilityCheck(true);
+        }
+        else
         {
-            if (SwFlyFrame* pSFly = SwIterator<SwFlyFrame, 
SwFormat>(*this).First())
-            {
-                SwFrame *pSFlyLower = pSFly->Lower();
-                if (pSFlyLower && !pSFlyLower->IsNoTextFrame())
-                {
-                    if (SwTextNode* pSwTxtNode = 
static_cast<SwTextFrame*>(pSFly->ContainsContent())->GetTextNodeFirst())
-                        pSwTxtNode->resetAndQueueAccessibilityCheck(true);
-                }
-                else
-                {
-                    if (SwNode* pSwNode = 
static_cast<SwNoTextFrame*>(pSFlyLower)->GetNode())
-                        pSwNode->resetAndQueueAccessibilityCheck(true);
-                }
-            }
+            if (SwNode* pSwNode = 
static_cast<SwNoTextFrame*>(pSFlyLower)->GetNode())
+                pSwNode->resetAndQueueAccessibilityCheck(true);
         }
     }
     else

Reply via email to