diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-01-22 16:04:29 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-22 16:13:26 +0100 |
commit | 77479d619b3d22fc521be87a98587f031382b156 (patch) | |
tree | 4bb82b9c6cfba507a2b5a2a37ef5ea4ca16cdf82 /sw/qa | |
parent | d0fcf8340d5319524dd0f9d8fb24666229d5fd92 (diff) |
sw: DOCX export of TextFrame border/shadow testcase
Change-Id: I26be6fbd5f0cd95218cdd7235e1fc10eeafb6704
Diffstat (limited to 'sw/qa')
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/textframe-borders.docx | bin | 0 -> 10440 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/textframe-borders.docx b/sw/qa/extras/ooxmlexport/data/textframe-borders.docx Binary files differnew file mode 100755 index 000000000000..424ed2a32ce5 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/textframe-borders.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index c1fd412979fc..4ff3f984c620 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/table/ShadowFormat.hpp> #include <com/sun/star/text/XPageCursor.hpp> #include <unotools/tempfile.hxx> @@ -69,6 +70,7 @@ public: void testN789482(); void test1Table1Page(); void testTextFrames(); + void testTextFrameBorders(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -109,6 +111,7 @@ void Test::run() {"n789482.docx", &Test::testN789482}, // {"1-table-1-page.docx", &Test::test1Table1Page}, // doesn't work on openSUSE12.2 at least {"textframes.odt", &Test::testTextFrames}, + {"textframe-borders.docx", &Test::testTextFrameBorders} }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -519,6 +522,23 @@ void Test::testTextFrames() CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount()); } +void Test::testTextFrameBorders() +{ + 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")); + + 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); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |