[Libreoffice-commits] core.git: sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 20 07:53:51 UTC 2020


 sw/source/core/crsr/crsrsh.cxx |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit ddd9bfd1482fd18a483c91fc0c83f4693422201d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Apr 20 08:26:05 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Apr 20 09:53:11 2020 +0200

    cid#1462317 Dereference after null check
    
    after
        commit 9a3b47afab1750eba0451d59a8bac53302d85b2f
        loplugin:buriedassign in sw(1)
    
    Change-Id: Ia15c9a9df18d043bc8fcbd12a688dced29141091
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92516
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index d7b4ffc1988b..5c5e01f1c871 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1230,15 +1230,11 @@ sal_uInt16 SwCursorShell::GetPageNumSeqNonEmpty()
     const SwContentFrame* pCFrame = GetCurrFrame(/*bCalcFrame*/true);
     const SwPageFrame* pPg = nullptr;
 
-    if (!pCFrame )
+    if (pCFrame == nullptr || nullptr == (pPg = pCFrame->FindPageFrame()))
     {
-        pPg = pCFrame->FindPageFrame();
-        if( !pPg )
-        {
-            pPg = Imp()->GetFirstVisPage(GetOut());
-            while (pPg && pPg->IsEmptyPage())
-                pPg = static_cast<const SwPageFrame*>(pPg->GetNext());
-        }
+        pPg = Imp()->GetFirstVisPage(GetOut());
+        while (pPg && pPg->IsEmptyPage())
+            pPg = static_cast<const SwPageFrame*>(pPg->GetNext());
     }
 
     sal_uInt16 nPageNo = 0;


More information about the Libreoffice-commits mailing list