sw/source/core/text/widorp.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f70f822532d96feebd24645009f0368405dac9e4
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Jul 17 21:37:07 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Jul 27 15:24:22 2023 +0200

    tdf#153319 sw: don't move footnotes to follow if portions in master
    
    SwTextFrameBreak::IsInside() may be called in different situations,
    during formatting it should be possible to move the footnotes, but when
    called from SwTextFrame::CalcPreps() this is problematic as it does not
    format the lines, it iterates over existing lines.
    
    The problem is that the footnote frame is moved to the follow's page,
    but the footnote portion remains on the master, and then the follow is
    joined while the footnote frame's mpReference still points to it.
    
    (regression from commit 391613785ae6fbb735cf7a86ea2f6a93161a8769)
    
    Change-Id: I4290dcd242a7f5292ad4f50c1407c9cd88e80a6a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154557
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 7e9b2b71db72b8c4c9c6ca83d08d3b6b05775ac8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154545
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index ceae9ee8d70c..b4fe1f9d4440 100644
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -178,6 +178,8 @@ bool SwTextFrameBreak::IsInside( SwTextMargin const &rLine 
) const
             }
         }
         if (!bFit && rLine.MaybeHasHints() && m_pFrame->GetFollow()
+            // tdf#153319 RemoveFootnote only works if this frame doesn't
+            && !rLine.GetNext() // contain the footnote portion
             // if using same footnote container as the follow, pointless to 
try?
             && m_pFrame->FindFootnoteBossFrame() != 
m_pFrame->GetFollow()->FindFootnoteBossFrame())
         {

Reply via email to