sw/qa/extras/layout/data/fdo48718-1.docx |binary
 sw/qa/extras/layout/layout3.cxx          |   12 ++++++++++++
 sw/source/core/layout/tabfrm.cxx         |    3 ++-
 3 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 54b8b66cc7a155c2485b4edbd9fa1342ee522a75
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Wed Jun 26 15:44:44 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Jun 26 19:59:44 2024 +0200

    tdf#161348 sw: layout: ignore footnotes when splitting float table row
    
    (regression from commit 534d3818aedfa95ad73935235462f5ec2817f5da)
    
    Change-Id: I169d88375a93c288604a89ef89f7e895830446c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169570
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 68e7413b5f9ce4abd2a4e23bf27cfc335e52f03f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169562

diff --git a/sw/qa/extras/layout/data/fdo48718-1.docx 
b/sw/qa/extras/layout/data/fdo48718-1.docx
new file mode 100644
index 000000000000..373aa357fd5c
Binary files /dev/null and b/sw/qa/extras/layout/data/fdo48718-1.docx differ
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index 8cc6216c977d..ed5d44df22f8 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -2290,6 +2290,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138124)
                 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf161348)
+{
+    createSwDoc("fdo48718-1.docx");
+
+    xmlDocUniquePtr pXml = parseLayoutDump();
+
+    // the floating table is on page 1
+    // apparently both parts of the split table are on this text frame
+    assertXPath(pXml, "/root/page[1]/body/txt[2]/anchored/fly"_ostr, 2);
+    assertXPath(pXml, "/root/page[1]/body/txt[2]/anchored/fly/tab"_ostr, 2);
+}
+
 CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf154113)
 {
     createSwDoc("three_sections.fodt");
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index efc716052fe0..42116672708f 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -807,7 +807,8 @@ static bool lcl_RecalcSplitLine( SwRowFrame& rLastLine, 
SwRowFrame& rFollowLine,
         bRet = false;
 
     // apparently checking nFootnoteHeight here does *not* guarantee that it 
fits into the body
-    if (bRet && nDistanceToFootnoteBodyPrtBottom + nFollowFootnotes < 0)
+    if (bRet && rTab.IsInDocBody()
+        && nDistanceToFootnoteBodyPrtBottom + nFollowFootnotes < 0)
     {
         assert(rTab.GetUpper() != 
rTab.FindFootnoteBossFrame()->FindBodyCont());
         SAL_INFO("sw.layout", "SwTabFrame Split failed because of footnote 
growth");

Reply via email to