summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-19 11:40:12 +0200
committerMichael Stahl <mstahl@redhat.com>2017-06-22 09:53:06 +0200
commit4c0b3520b66477334a7971dbed7ffcdcd265e749 (patch)
tree022529c71b707106251a7ceef713fa6643c23150
parentfb1b69a78742373f5652e731d0f32da1d159422c (diff)
tdf#101821 sw: layout: don't move endnotes into footnotes' container
The bugdoc has a single 1-column section from start to end, no footnotes but lots of endnotes, and the section has the settings "Footnotes - collect at end of text" unchecked and "Endnotes - collect at end of section" checked. This means that the SwFootnoteContFrame for footnotes would be put directly below the SwPageFrame (so that multiple sections on a single page can share it), but the SwFootnoteContFrame for the endnotes is put below the SwColumnFrame (which is created despite only 1 column) below the SwSectionFrame. Hence content in endnotes has the mbInfSct flag set, and the crash happens because the endnotes are moved from below the SwSectionFrame to a new SwFootnoteContFrame that is directly below a SwPageFrame, without clearing the mbInfSct flag. Fix the wrong call in SwFootnoteBossFrame::MoveFootnotes_() to FindFootnoteBossFrame() that resulted in the wrong (unsuitable for endnotes) SwFootnoteContFrame to be used as the target for the move. Change-Id: I64f6b86441e5ac1f16433f005e97c274a1c69dfa
-rw-r--r--sw/source/core/layout/ftnfrm.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 8084d28e5a8b..e14b50289733 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1904,7 +1904,8 @@ void SwFootnoteBossFrame::MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool b
SwFootnoteFrame* pLastInsertedFootnote = nullptr;
for (SwFootnoteFrame* pFootnote : rFootnoteArr)
{
- SwFootnoteBossFrame* pRefBoss = pFootnote->GetRef()->FindFootnoteBossFrame( true );
+ SwFootnoteBossFrame* pRefBoss(pFootnote->GetRef()->FindFootnoteBossFrame(
+ !pFootnote->GetAttr()->GetFootnote().IsEndNote()));
if( pRefBoss != this )
{
const sal_uInt16 nRefNum = pRefBoss->FindPageFrame()->GetPhyPageNum();