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:35 +0200
commit2d34d70eb928f6818d9f68f1da07673ce48f90ea (patch)
tree606678843069bedfe2f377c887040cf0bebe5c97 /sw
parent20ca5b5fae58ee46362fbd4c5f51ee21e89c3c35 (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/39104 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 6ec9160ac346..290240b63e9b 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -1905,7 +1905,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();