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

New commits:
commit 0496252c2c7fd2d694c4a73f387ef75e0021de3e
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue May 24 15:20:42 2022 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue May 24 17:01:13 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>

diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index ca3478b3f85f..cb50c4613006 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -3013,7 +3013,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