summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-04-18 11:46:09 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-04-18 12:44:35 +0200
commit1ee5ae0eec2d1c673af6b8f18a2c36b4d1e7fb70 (patch)
tree3d0174c300cce901d39d30a2073d67b76f7ce6a4 /sw
parent10f2e8363076fb9217b4fc8acf12b4d9c13328cc (diff)
sw floattable: fix CppunitTest_sw_ww8export2's testTdf80635_marginLeft
The rendering is unchanged, but now the fly is positioned, the inner table doesn't have an own offset. Change-Id: I6ffaeb2672e04b3b855cbcb63ceba6506b970399 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150545 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index 4c829aed0204..f097979b3901 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -312,14 +312,22 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_marginRTL, "tdf80635_marginRightRTL.doc")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient"));
}
-DECLARE_WW8EXPORT_TEST(testTdf80635_marginLeft, "tdf80635_marginLeft.doc")
+CPPUNIT_TEST_FIXTURE(Test, testTdf80635_marginLeft)
{
- // tdf#80635 - transfer the float orientation to the table.
- 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);
- // This was just the GetMinLeft of -199
- CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", tools::Long(-2950), getProperty<tools::Long>(xTable, "LeftMargin"), 100);
+ SwModelTestBase::FlySplitGuard aGuard;
+ auto verify = [this]() {
+ // tdf#80635 - assert horizontal position of the table.
+ 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);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", tools::Long(0), getProperty<tools::Long>(xTable, "LeftMargin"), 100);
+ uno::Reference<drawing::XShape> xFly = getShape(1);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-2958), getProperty<sal_Int32>(xFly, "HoriOrientPosition"));
+ };
+ createSwDoc("tdf80635_marginLeft.doc");
+ verify();
+ reload(mpFilter, "tdf80635_marginLeft.doc");
+ verify();
}
DECLARE_WW8EXPORT_TEST(testTdf80635_pageLeft, "tdf80635_pageLeft.doc")