diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-05-29 15:22:14 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-05-29 15:56:51 +0200 |
commit | 8931c8f3c58afe35b5b7c98e136825aff04291e3 (patch) | |
tree | e7f4472f6fa72c355563a3b0d5d97a67f9762823 /sw/qa/extras | |
parent | f2720b87093968670e3fb47d24d4952f1631a654 (diff) |
bnc#817956 v:textpath VML import testcase
Change-Id: I4c4c3a84e8d9d048262e6570a8bed0106e8d184f
Diffstat (limited to 'sw/qa/extras')
-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 3a765b74b810..36fc88302176 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -114,6 +114,7 @@ public: void testN779630(); void testIndentation(); void testPageBackground(); + void testWatermark(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -196,6 +197,7 @@ void Test::run() {"n779630.docx", &Test::testN779630}, {"indentation.docx", &Test::testIndentation}, {"page-background.docx", &Test::testPageBackground}, + {"watermark.docx", &Test::testWatermark}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1392,6 +1394,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(); |