sw/source/core/layout/wsfrm.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit c3a1f4cc50fa4a17589ca1b4643a554964af59a3
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue May 24 15:20:42 2022 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat May 28 22:32:39 2022 +0200

    sw: fix mysterious layout loop in CppunitTest_sw_uiwriter3 testTdf104649
    
    This didn't happen with master from a week ago on Fedora 35, but happens
    with Monday's master on Fedora 36. Also happens with libreoffice-7-3
    branch.
    
    Fundamentally the problem with the bugdoc is that there are tables in
    footnotes, which aren't really supported and can't split across pages
    like they would need to.
    
    The loop happens because a footnote on page 48 invalidates position of
    its anchor frame 549 on page 45.
    
    This is probably pointless, let's only invalidate if the anchor is on
    the same page (it should be on the same page, but probably the tables in
    other footnotes get in the way).
    
    Change-Id: I87976c7f8b35725bc8e642133bebb396d37ff0be
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134877
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 0496252c2c7fd2d694c4a73f387ef75e0021de3e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134894
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 62c99a5f6e87..43bd9a7037a1 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -3001,7 +3001,16 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool 
bTst, bool bInfo )
                 pTmp->InvalidateSize();
             }
             else
-                pCnt->InvalidatePos();
+            {
+                if (pCnt->FindPageFrame() == FindPageFrame())
+                {
+                    pCnt->InvalidatePos();
+                }
+                else
+                {
+                    SAL_WARN("sw.layout", "footnote frame on different page 
than ref frame?");
+                }
+            }
         }
     }
     return nReal;

Reply via email to