diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-06-07 16:48:00 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-06-07 17:02:12 +0200 |
commit | 133822bd25e269441faaefe7c1e67091d6692e39 (patch) | |
tree | bcde0506a4acee2eda1d40cf7fba7ed3d6e0fe0f /sw/qa | |
parent | 21eca1c73ffbec4417dad46bd103215e8e288880 (diff) |
testcase of the alignment + anchored inline part of bnc#764745
Change-Id: Iab82a88473c0c1d7cf75fcc1f2064bca105b0293
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmltok/data/n764745-alignment.docx | bin | 0 -> 5635 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmltok/ooxmltok.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n764745-alignment.docx b/sw/qa/extras/ooxmltok/data/n764745-alignment.docx Binary files differnew file mode 100644 index 000000000000..d29e980e51ed --- /dev/null +++ b/sw/qa/extras/ooxmltok/data/n764745-alignment.docx diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx index 2b050eb0ae55..dbd56cdaf2e5 100644 --- a/sw/qa/extras/ooxmltok/ooxmltok.cxx +++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx @@ -65,6 +65,7 @@ public: void testN760764(); void testN764005(); void testSmartart(); + void testN764745(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -83,6 +84,7 @@ public: CPPUNIT_TEST(testN760764); CPPUNIT_TEST(testN764005); CPPUNIT_TEST(testSmartart); + CPPUNIT_TEST(testN764745); #endif CPPUNIT_TEST_SUITE_END(); @@ -472,6 +474,23 @@ void Test::testSmartart() CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_CENTER), nValue); // Paragraph properties are imported } +void Test::testN764745() +{ + load( "n764745-alignment.docx" ); + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(0), uno::UNO_QUERY); + // The paragraph is right-aligned and the picture does not explicitly specify position, + // so check it's anchored as character and in the right side of the document. + text::TextContentAnchorType anchorType; + xPropertySet->getPropertyValue("AnchorType") >>= anchorType; + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, anchorType); + awt::Point pos; + xPropertySet->getPropertyValue("AnchorPosition") >>= pos; + // not sure how to find out the document width, but in my test the anchor x is >12000 + CPPUNIT_ASSERT( pos.X > 10000 ); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |