sw/qa/extras/ww8export/ww8export2.cxx |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

New commits:
commit 1ee5ae0eec2d1c673af6b8f18a2c36b4d1e7fb70
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Apr 18 11:46:09 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Apr 18 12:44:35 2023 +0200

    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 <vmik...@collabora.com>
    Tested-by: Jenkins

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")

Reply via email to