Kaydet (Commit) 8931c8f3 authored tarafından Miklos Vajna's avatar Miklos Vajna

bnc#817956 v:textpath VML import testcase

Change-Id: I4c4c3a84e8d9d048262e6570a8bed0106e8d184f
üst f2720b87
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment