summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-06-07 16:48:00 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-06-07 17:02:12 +0200
commit133822bd25e269441faaefe7c1e67091d6692e39 (patch)
treebcde0506a4acee2eda1d40cf7fba7ed3d6e0fe0f
parent21eca1c73ffbec4417dad46bd103215e8e288880 (diff)
testcase of the alignment + anchored inline part of bnc#764745
Change-Id: Iab82a88473c0c1d7cf75fcc1f2064bca105b0293
-rw-r--r--sw/qa/extras/ooxmltok/data/n764745-alignment.docxbin0 -> 5635 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx19
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
new file mode 100644
index 000000000000..d29e980e51ed
--- /dev/null
+++ b/sw/qa/extras/ooxmltok/data/n764745-alignment.docx
Binary files differ
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();