diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-06-19 11:40:12 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-07-06 15:34:33 +0200 |
commit | b75b0bd20a3805af9f6a329c9b365b3b6a276f50 (patch) | |
tree | 19ad64aaaea1b9bf4f28fdb43d5f340591f74ec7 | |
parent | 18c1755460f57a626e72987d1f3e8c326c82f441 (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>
(cherry picked from commit 2d34d70eb928f6818d9f68f1da07673ce48f90ea)
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 3 |
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(); |