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

Caolán McNamara caolanm at redhat.com
Fri Mar 2 15:28:47 UTC 2018


 sw/source/core/layout/findfrm.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 58015c85ebc51571287255e5871901e72c4355e6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 2 13:38:43 2018 +0000

    related forcepoint #18, reconcile GetPrevCellLeaf with GetNextCellLeaf
    
    Change-Id: I8998956676ba146cac6f8339a3f5c550f0aabc2e
    Reviewed-on: https://gerrit.libreoffice.org/50634
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 494920dc6281..4f2453e09f93 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1448,11 +1448,11 @@ SwLayoutFrame* SwFrame::GetNextCellLeaf()
 SwLayoutFrame* SwFrame::GetPrevCellLeaf()
 {
     SwFrame* pTmpFrame = this;
-    while ( !pTmpFrame->IsCellFrame() )
+    while (pTmpFrame && !pTmpFrame->IsCellFrame())
         pTmpFrame = pTmpFrame->GetUpper();
 
-    OSL_ENSURE( pTmpFrame, "SwFrame::GetNextPreviousLeaf() without cell" );
-    return static_cast<SwCellFrame*>(pTmpFrame)->GetPreviousCell();
+    SAL_WARN_IF(!pTmpFrame, "sw.core", "SwFrame::GetNextPreviousLeaf() without cell");
+    return pTmpFrame ? static_cast<SwCellFrame*>(pTmpFrame)->GetPreviousCell() : nullptr;
 }
 
 static SwCellFrame* lcl_FindCorrespondingCellFrame( const SwRowFrame& rOrigRow,


More information about the Libreoffice-commits mailing list