diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2024-06-26 15:44:44 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2024-06-26 18:28:32 +0200 |
commit | 68e7413b5f9ce4abd2a4e23bf27cfc335e52f03f (patch) | |
tree | 532d714c75a6f7dded11897587cb5ead7ca94b3c | |
parent | 879bcc88759d7dd033e0ee667daee0d2a743cf06 (diff) |
tdf#156724 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.stahl@allotropia.de>
-rw-r--r-- | sw/qa/extras/layout/data/fdo48718-1.docx | bin | 0 -> 25400 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout3.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/fdo48718-1.docx b/sw/qa/extras/layout/data/fdo48718-1.docx Binary files differnew file mode 100644 index 000000000000..373aa357fd5c --- /dev/null +++ b/sw/qa/extras/layout/data/fdo48718-1.docx diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 7c36605bb82d..3ee4953e52cc 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"); |