diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-04-18 08:16:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-04-18 10:09:08 +0200 |
commit | 16b59cee44c7f728b2fe6d7b624c494f649ee79f (patch) | |
tree | afcc29e5d426592bf7a3d43bba941138f0e3aafc /sw/qa | |
parent | ac30e6bfb653490003d04f30bf2d5f8f857e572b (diff) |
sw floattable, layout: don't split inside headers/footers
CppunitTest_sw_ww8export2's testTdf128700_relativeTableWidth had a
layout loop in the SW_FORCE_FLY_SPLIT=1 case.
This seems to happen because the footer had a big floating table, which
doesn't fit the anchor's upper, but adding more pages won't help the
table to fit.
Fix the problem by not trying to split floating tables in
headers/footers.
An alternative would be to filter this out at import time, but then we
would loose the setting on DOCX/DOC roundtrip, which is not ideal.
Change-Id: Ice97159563812acee823dbd00b364601db293ed9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150535
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 8252f63504f0..4c829aed0204 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -85,15 +85,24 @@ DECLARE_WW8EXPORT_TEST(testTdf55528_relativeTableWidth, "tdf55528_relativeTableW CPPUNIT_ASSERT_EQUAL_MESSAGE("Table relative width percent", sal_Int16(98), getProperty<sal_Int16>(xTable, "RelativeWidth")); } -DECLARE_WW8EXPORT_TEST(testTdf128700_relativeTableWidth, "tdf128700_relativeTableWidth.doc") +CPPUNIT_TEST_FIXTURE(Test, testTdf128700_relativeTableWidth) { - uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); - uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + SwModelTestBase::FlySplitGuard aGuard; - // Since the table has been converted into a floating frame, the relative width either needed to be transferred - // onto the frame, or else just thrown out. Otherwise it becomes relative to the size of the frame. - CPPUNIT_ASSERT_EQUAL_MESSAGE("Floated table can't use relative width", sal_Int16(0), getProperty<sal_Int16>(xTable, "RelativeWidth")); + auto verify = [this]() { + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + // Since the table has been converted into a floating frame, the relative width either needed to be transferred + // onto the frame, or else just thrown out. Otherwise it becomes relative to the size of the frame. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Floated table can't use relative width", sal_Int16(0), getProperty<sal_Int16>(xTable, "RelativeWidth")); + }; + // This also resulted in a layout loop when flys were allowed to split in footers. + createSwDoc("tdf128700_relativeTableWidth.doc"); + verify(); + reload(mpFilter, "tdf128700_relativeTableWidth.doc"); + verify(); } CPPUNIT_TEST_FIXTURE(Test, testTdf116436_tableBackground) |