diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-05-29 15:22:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-05-30 15:54:15 +0200 |
commit | 44ad989229d09179b045210ef67c29a1df90def6 (patch) | |
tree | e7261f586e71910ac4015b191d46d29b6687994a /sw | |
parent | 56eeebb39a72fa90f945fe54e3af8a2c3a2918c2 (diff) |
bnc#817956 v:textpath VML import testcase
Change-Id: I4c4c3a84e8d9d048262e6570a8bed0106e8d184f
(cherry picked from commit 8931c8f3c58afe35b5b7c98e136825aff04291e3)
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/qa/extras/ooxmlimport/data/watermark.docx | bin | 0 -> 14766 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/watermark.docx b/sw/qa/extras/ooxmlimport/data/watermark.docx Binary files differnew file mode 100755 index 000000000000..8e279e3e857f --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/watermark.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 69862e5b6a98..8d55c28365bb 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -119,6 +119,7 @@ public: void testN592908_Frame(); void testN592908_Picture(); void testPageBackground(); + void testWatermark(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -190,6 +191,7 @@ void Test::run() {"n592908-frame.docx", &Test::testN592908_Frame}, {"n592908-picture.docx", &Test::testN592908_Picture}, {"page-background.docx", &Test::testPageBackground}, + {"watermark.docx", &Test::testWatermark}, }; for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) { @@ -1188,6 +1190,30 @@ void Test::testPageBackground() CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor")); } +void Test::testWatermark() +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xShape(xDraws->getByIndex(0), uno::UNO_QUERY); + // 1st problem: last character was missing + CPPUNIT_ASSERT_EQUAL(OUString("SAMPLE"), xShape->getString()); + + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"); + bool bFound = false; + for (int i = 0; i < aProps.getLength(); ++i) + if (aProps[i].Name == "TextPath") + bFound = true; + // 2nd problem: v:textpath wasn't imported + CPPUNIT_ASSERT_EQUAL(true, bFound); + + // 3rd problem: rotation angle was 315, not 45. + CPPUNIT_ASSERT_EQUAL(sal_Int32(45 * 100), getProperty<sal_Int32>(xShape, "RotateAngle")); + + // 4th problem: mso-position-vertical-relative:margin was ignored, VertOrientRelation was text::RelOrientation::FRAME. + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_PRINT_AREA, getProperty<sal_Int16>(xShape, "VertOrientRelation")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |