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

New commits:
commit c5199bf7e054bee4933b8cffe6855c621e551797
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Apr 19 10:39:30 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Apr 20 15:06:34 2023 +0200

    sw floattable: fix CppunitTest_sw_ww8export2's testTdf80635_pageLeft
    
    Assert that the left of the floating table is around the page edge, not
    some larger value from the left of the body frame.
    
    Change-Id: Ibb5ddf64706dc2296b0aaf2273d216ee63fae63f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150600
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit 115a4eb944f6a49def1ba8e826c3258389aeab10)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150671
    Tested-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/ww8export/ww8export2.cxx 
b/sw/qa/extras/ww8export/ww8export2.cxx
index 6cb1c43c748e..ea063de8be19 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -334,14 +334,20 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf80635_marginLeft)
     verify();
 }
 
-DECLARE_WW8EXPORT_TEST(testTdf80635_pageLeft, "tdf80635_pageLeft.doc")
+CPPUNIT_TEST_FIXTURE(Test, testTdf80635_pageLeft)
 {
-    // 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(-2750), 
getProperty<tools::Long>(xTable, "LeftMargin"), 100);
+    SwModelTestBase::FlySplitGuard aGuard;
+    auto verify = [this]() {
+        // tdf#80635 - assert horizontal orient relation of the table.
+        uno::Reference<drawing::XShape> xFly = getShape(1);
+        CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, 
getProperty<sal_Int16>(xFly, "HoriOrientRelation"));
+        CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::NONE, 
getProperty<sal_Int16>(xFly, "HoriOrient"));
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(-189), getProperty<sal_Int32>(xFly, 
"HoriOrientPosition"));
+    };
+    createSwDoc("tdf80635_pageLeft.doc");
+    verify();
+    reload(mpFilter, "tdf80635_pageLeft.doc");
+    verify();
 }
 
 DECLARE_WW8EXPORT_TEST(testTdf99197_defaultLTR, "tdf99197_defaultLTR.doc")

Reply via email to