diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 50703c0e00af..8bf3a58b0e8f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1084,11 +1084,24 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloating, "table-floating.docx") uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - // This was 0, should be the the opposite of (left margin + half of the border width). - CPPUNIT_ASSERT_EQUAL(sal_Int32(-199), getProperty(xFrame, "HoriOrientPosition")); - // Was 0 as well, should be the right margin. - CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty(xFrame, "RightMargin")); + if (xIndexAccess->getCount()) + { + // After import, table is inside a TextFrame. + uno::Reference xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + // This was 0, should be the the opposite of (left margin + half of the border width). + CPPUNIT_ASSERT_EQUAL(sal_Int32(-199), getProperty(xFrame, "HoriOrientPosition")); + // Was 0 as well, should be the right margin. + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty(xFrame, "RightMargin")); + } + else + { + // After import, table is inside a TextFrame. + uno::Reference xShape(getShape(1), uno::UNO_QUERY); + // This was 0, should be the the opposite of (left margin + half of the border width). + CPPUNIT_ASSERT_EQUAL(sal_Int32(-198), getProperty(xShape, "HoriOrientPosition")); + // Was 0 as well, should be the right margin. + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty(xShape, "RightMargin")); + } } DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_0, "fdo44689_start_page_0.docx")