diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-10 16:33:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-10 17:09:09 +0200 |
commit | 147d3f61c4730ac1e545b02888a043f88dc8e3ad (patch) | |
tree | 712413f5f80e7315c865161423bdf2df3bbea4d2 /sw/qa/extras/ooxmlexport | |
parent | fa8c1752ee05eaef5019d9c00d53bbb585fe1130 (diff) |
CppunitTest_sw_ooxmlexport: port testTextFrameBorders to textboxes
Change-Id: Idf837c1eecc3a5e0d6c82126685e4720e78b4481
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index df61c77e2eaf..33556d19d806 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -522,17 +522,34 @@ DECLARE_OOXMLEXPORT_TEST(testTextFrameBorders, "textframe-borders.docx") { uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); - uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xFrame, "BackColor")); + if (xIndexAccess->getCount()) + { + // After import, a TextFrame is created by the VML import. + uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xFrame, "BackColor")); - table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder"); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aBorder.Color); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), aBorder.LineWidth); + table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xFrame, "TopBorder"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), aBorder.Color); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(35), aBorder.LineWidth); - table::ShadowFormat aShadowFormat = getProperty<table::ShadowFormat>(xFrame, "ShadowFormat"); - CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadowFormat.Location); - CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); + table::ShadowFormat aShadowFormat = getProperty<table::ShadowFormat>(xFrame, "ShadowFormat"); + CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadowFormat.Location); + CPPUNIT_ASSERT_EQUAL(sal_Int16(48), aShadowFormat.ShadowWidth); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), aShadowFormat.Color); + } + else + { + // After export and import, the result is a shape. + uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD99594), getProperty<sal_Int32>(xShape, "FillColor")); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xC0504D), getProperty<sal_Int32>(xShape, "LineColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(35), getProperty<sal_Int32>(xShape, "LineWidth")); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(48), getProperty<sal_Int32>(xShape, "ShadowXDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(48), getProperty<sal_Int32>(xShape, "ShadowYDistance")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x622423), getProperty<sal_Int32>(xShape, "ShadowColor")); + } } DECLARE_OOXMLEXPORT_TEST(testTextframeGradient, "textframe-gradient.docx") |