diff options
Diffstat (limited to 'sw/qa')
-rwxr-xr-x | sw/qa/extras/ooxmlexport/data/a4andborders.docx | bin | 0 -> 10014 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/a4andborders.docx b/sw/qa/extras/ooxmlexport/data/a4andborders.docx Binary files differnew file mode 100755 index 000000000000..afeb91cda73d --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/a4andborders.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index b9c5ba77fd77..1445cccceb11 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -114,6 +114,7 @@ public: void testTransparentShadow(); void testBnc834035(); void testFdo68418(); + void testA4AndBorders(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -204,6 +205,7 @@ void Test::run() {"transparent-shadow.docx", &Test::testTransparentShadow}, {"bnc834035.odt", &Test::testBnc834035}, {"fdo68418.docx", &Test::testFdo68418}, + {"a4andborders.docx", &Test::testA4AndBorders}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -1250,6 +1252,18 @@ void Test::testFdo68418() CPPUNIT_ASSERT_EQUAL(OUString("aaaa"), xFooterParagraph->getString()); // I get an error that it expects '' } +void Test::testA4AndBorders() +{ + /* + * The problem was that in case of a document with borders, the pgSz attribute + * was exported as a child of pgBorders, thus being ignored on reload. + * We assert dimension against A4 size in mm (to avoid minor rounding errors) + */ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect Page Width (mm)", sal_Int32(210), getProperty<sal_Int32>(xPageStyle, "Width") / 100); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect Page Height (mm)", sal_Int32(297), getProperty<sal_Int32>(xPageStyle, "Height") / 100); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |