diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-10 18:27:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-10 18:34:54 +0200 |
commit | ab4279d7f2e613f69d21eef1e3ba6bf09b708b00 (patch) | |
tree | 2ca6e12c381e7912cc3cc81c5335606cecbccc84 | |
parent | CppunitTest_sw_ooxmlexport: port testFdo60990 to textboxes (diff) | |
download | core-ab4279d7f2e613f69d21eef1e3ba6bf09b708b00.tar.gz core-ab4279d7f2e613f69d21eef1e3ba6bf09b708b00.zip |
CppunitTest_sw_ooxmlexport: port testTableFloating to textboxes
Change-Id: Ie20e0ca939139c952f3524c7dae494e24bc7cab7
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
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<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference<beans::XPropertySet> 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<sal_Int32>(xFrame, "HoriOrientPosition")); - // Was 0 as well, should be the right margin. - CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xFrame, "RightMargin")); + if (xIndexAccess->getCount()) + { + // After import, table is inside a TextFrame. + uno::Reference<beans::XPropertySet> 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<sal_Int32>(xFrame, "HoriOrientPosition")); + // Was 0 as well, should be the right margin. + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xFrame, "RightMargin")); + } + else + { + // After import, table is inside a TextFrame. + uno::Reference<beans::XPropertySet> 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<sal_Int32>(xShape, "HoriOrientPosition")); + // Was 0 as well, should be the right margin. + CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xShape, "RightMargin")); + } } DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_0, "fdo44689_start_page_0.docx") |