summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-07-24 11:35:01 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-07-24 12:11:13 +0200
commitafe463fb62225fdc526343fb2020ced790c61251 (patch)
tree335f32e454f7f177949fc7dc04031e7cc7f04cf8 /sw
parentd978bc31bf821d9698b2fdb5c277b239704d9776 (diff)
SfxGrabBagItem testcase
Change-Id: I1386ab7a0680460bd98648d2803b1b7e0326e093
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/grabbag.docxbin0 -> 9989 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx13
2 files changed, 12 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/grabbag.docx b/sw/qa/extras/ooxmlexport/data/grabbag.docx
new file mode 100755
index 000000000000..0aca64d6ee64
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/grabbag.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index afaa0610bb91..24ad76ef9553 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -98,6 +98,7 @@ public:
void testFdo66929();
void testFdo66145();
void testPageBorderSpacingExportCase2();
+ void testGrabBag();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -114,7 +115,7 @@ private:
* xml stream, so that you can do the asserting.
*/
xmlDocPtr parseExport();
- void assertXPath(xmlDocPtr pXmlDoc, OString aXPath, OString aAttribute, OUString aExpectedValue);
+ void assertXPath(xmlDocPtr pXmlDoc, OString aXPath, OString aAttribute = OString(), OUString aExpectedValue = OUString());
};
void Test::run()
@@ -174,6 +175,7 @@ void Test::run()
{"bnc581614.doc", &Test::testBnc581614},
{"fdo66929.docx", &Test::testFdo66929},
{"page-borders-export-case-2.docx", &Test::testPageBorderSpacingExportCase2},
+ {"grabbag.docx", &Test::testGrabBag},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -227,6 +229,8 @@ void Test::assertXPath(xmlDocPtr pXmlDoc, OString aXPath, OString aAttribute, OU
xmlXPathObjectPtr pXmlXpathObj = xmlXPathEvalExpression(BAD_CAST(aXPath.getStr()), pXmlXpathCtx);
xmlNodeSetPtr pXmlNodes = pXmlXpathObj->nodesetval;
CPPUNIT_ASSERT_EQUAL(1, xmlXPathNodeSetGetLength(pXmlNodes));
+ if (aAttribute.isEmpty())
+ return;
xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0];
OUString aValue = OUString::createFromAscii((const char*)xmlGetProp(pXmlNode, BAD_CAST(aAttribute.getStr())));
CPPUNIT_ASSERT_EQUAL(aExpectedValue, aValue);
@@ -1012,6 +1016,13 @@ void Test::testFdo66145()
CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(xPropertySet, "FirstIsShared")));
}
+void Test::testGrabBag()
+{
+ // w:mirrorIndents was lost on roundtrip, now should be handled as a grab bag property
+ xmlDocPtr pXmlDoc = parseExport();
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:pPr/w:mirrorIndents");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();