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

Caolán McNamara caolanm at redhat.com
Sun Jun 25 20:26:05 UTC 2017


 sw/source/core/layout/ftnfrm.cxx  |   12 +++++-------
 sw/source/core/layout/sectfrm.cxx |    2 +-
 sw/source/core/layout/trvlfrm.cxx |    8 ++++----
 3 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit 55d4cc340068b0f590ab3a2119a2a2a71a3f8e5e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jun 25 21:07:24 2017 +0100

    crashtesting failure on ooo61225-1.sxw
    
    Change-Id: Ia953443ba352aea1b33b6efd312a0e95a6b8918e
    Reviewed-on: https://gerrit.libreoffice.org/39244
    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/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index e14b50289733..e608ba7ca793 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -802,13 +802,11 @@ bool SwFrame::IsFootnoteAllowed() const
     if ( !IsInDocBody() )
         return false;
 
-    if ( IsInTab() )
-    {
-        // no footnotes in repeated headlines
-        const SwTabFrame *pTab = const_cast<SwFrame*>(this)->ImplFindTabFrame();
-        if ( pTab->IsFollow() )
-            return !pTab->IsInHeadline( *this );
-    }
+    // no footnotes in repeated headlines
+    const SwTabFrame *pTab = IsInTab() ? const_cast<SwFrame*>(this)->ImplFindTabFrame() : nullptr;
+    if (pTab && pTab->IsFollow())
+        return !pTab->IsInHeadline(*this);
+
     return true;
 }
 
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 06c186c5d4c2..536b9e46f611 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -1526,7 +1526,7 @@ SwLayoutFrame *SwFrame::GetNextSctLeaf( MakePageType eMakePage )
         // This frame is in a table-not-in-section, its follow should be
         // inserted under the follow of the frame's cell.
         pLayLeaf = FindCellFrame()->GetFollowCell();
-        if (pLayLeaf->FindTabFrame() == FindTabFrame())
+        if (pLayLeaf && pLayLeaf->FindTabFrame() == FindTabFrame())
             SAL_WARN("sw.layout", "my table frame and my follow's table frame is the same");
         // In this case pLayLeaf pointing to an in-table frame is OK.
         bLayLeafTableAllowed = true;
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 05864d10a4ba..1a98adca4f8a 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1691,11 +1691,11 @@ bool SwFrame::WannaRightPage() const
     const SwFrame *pFlow = pPage->FindFirstBodyContent();
     const SwPageDesc *pDesc = nullptr;
     ::boost::optional<sal_uInt16> oPgNum;
-    if ( pFlow )
+    if (pFlow && pFlow->IsInTab())
+        pFlow = pFlow->FindTabFrame();
+    if (pFlow)
     {
-        if ( pFlow->IsInTab() )
-            pFlow = pFlow->FindTabFrame();
-        const SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame( pFlow );
+        const SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame(pFlow);
         if ( !pTmp->IsFollow() )
         {
             const SwFormatPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();


More information about the Libreoffice-commits mailing list