summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-25 21:07:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-06-25 22:25:43 +0200
commit55d4cc340068b0f590ab3a2119a2a2a71a3f8e5e (patch)
tree1d665419fb598237757c73e47ca91f6a5e90c61f
parent93d42c1b23721120fd2b61ee0b8842a14fd9b6b8 (diff)
crashtesting failure on ooo61225-1.sxw
Change-Id: Ia953443ba352aea1b33b6efd312a0e95a6b8918e Reviewed-on: https://gerrit.libreoffice.org/39244 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/layout/ftnfrm.cxx12
-rw-r--r--sw/source/core/layout/sectfrm.cxx2
-rw-r--r--sw/source/core/layout/trvlfrm.cxx8
3 files changed, 10 insertions, 12 deletions
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();