diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-05-23 15:51:41 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-05-23 15:54:11 +0200 |
commit | 10bdf6aa45f26f09e83f4c0035d27a4ddcd9151a (patch) | |
tree | 0adec2843dd4bba6d27154a98e85a12d970bf98e /sw | |
parent | 9365a3255875eb75923903c8b3d47066aa679c3b (diff) |
testcase for proper .docx ZOrder import
Change-Id: I0f025114af5f79f5bd04637ffdf864cef75eb821
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmltok/data/n747461.docx | bin | 0 -> 6489 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmltok/ooxmltok.cxx | 36 |
2 files changed, 36 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n747461.docx b/sw/qa/extras/ooxmltok/data/n747461.docx Binary files differnew file mode 100644 index 000000000000..1064e5db060b --- /dev/null +++ b/sw/qa/extras/ooxmltok/data/n747461.docx diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx index 4defe5d4d36d..da85c1414418 100644 --- a/sw/qa/extras/ooxmltok/ooxmltok.cxx +++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx @@ -58,6 +58,7 @@ public: void testN751077(); void testN705956_1(); void testN705956_2(); + void testN747461(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -70,6 +71,7 @@ public: CPPUNIT_TEST(testN751077); CPPUNIT_TEST(testN705956_1); CPPUNIT_TEST(testN705956_2); + CPPUNIT_TEST(testN747461); #endif CPPUNIT_TEST_SUITE_END(); @@ -285,6 +287,40 @@ xray image.FillColor CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor ); } +void Test::testN747461() +{ + load( "n747461.docx" ); +/* +The document contains 3 images (Red, Black, Green, in this order), with explicit +w:relativeHeight (300, 0, 225763766). Check that they are in the right ZOrder +after they are loaded. +*/ + uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPageSupplier> drawPageSupplier(textDocument, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> drawPage = drawPageSupplier->getDrawPage(); + uno::Reference<drawing::XShape> image1, image2, image3; + drawPage->getByIndex( 0 ) >>= image1; + drawPage->getByIndex( 1 ) >>= image2; + drawPage->getByIndex( 2 ) >>= image3; + sal_Int32 zOrder1, zOrder2, zOrder3; + OUString descr1, descr2, descr3; + uno::Reference<beans::XPropertySet> imageProperties1(image1, uno::UNO_QUERY); + imageProperties1->getPropertyValue( "ZOrder" ) >>= zOrder1; + imageProperties1->getPropertyValue( "Description" ) >>= descr1; + uno::Reference<beans::XPropertySet> imageProperties2(image2, uno::UNO_QUERY); + imageProperties2->getPropertyValue( "ZOrder" ) >>= zOrder2; + imageProperties2->getPropertyValue( "Description" ) >>= descr2; + uno::Reference<beans::XPropertySet> imageProperties3(image3, uno::UNO_QUERY); + imageProperties3->getPropertyValue( "ZOrder" ) >>= zOrder3; + imageProperties3->getPropertyValue( "Description" ) >>= descr3; + CPPUNIT_ASSERT_EQUAL( sal_Int32( 0 ), zOrder1 ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 1 ), zOrder2 ); + CPPUNIT_ASSERT_EQUAL( sal_Int32( 2 ), zOrder3 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Black" ), descr1 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 ); + CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 ); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |