summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-19 11:40:12 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-04 12:27:04 +0200
commit67f60fb315d8a7f235034bf2960ffb939033fcc4 (patch)
tree20f3e72c643db2949fae980146570eb916aeb8f0 /sw
parent7383812ad0c49c2c05d35b0ac4f5622e29d4d13c (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 (cherry picked from commit 4c0b3520b66477334a7971dbed7ffcdcd265e749) Reviewed-on: https://gerrit.libreoffice.org/39101 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-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 14790e03eed2..f6df5180d51c 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();