[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/source

Michael Stahl mstahl at redhat.com
Tue Jul 4 10:27:34 UTC 2017


 sw/source/core/layout/ftnfrm.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 67f60fb315d8a7f235034bf2960ffb939033fcc4
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jun 19 11:40:12 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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();


More information about the Libreoffice-commits mailing list