diff options
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf103090.odt | bin | 0 -> 8845 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf103090.odt b/sw/qa/extras/ooxmlexport/data/tdf103090.odt Binary files differnew file mode 100644 index 000000000000..d264f255abb7 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf103090.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 930cbdc41b4f..5f45cbcc7109 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -1049,6 +1049,28 @@ DECLARE_OOXMLEXPORT_TEST(tdf112169, "tdf112169.odt") // LO crashed while export because of character background color handling } +DECLARE_OOXMLEXPORT_TEST(testTdf103090, "tdf103090.odt") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + + // Get bookmark name + OUString bookmarkName = getXPath(pXmlDoc, "/w:document/w:body/w:p/w:bookmarkStart", "name"); + + // Ensure that name has no spaces + CPPUNIT_ASSERT(bookmarkName.indexOf(" ") < 0); + + // Get PAGEREF field + OUString fieldName = getXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText"); + + // Ensure that PAGEREF field refers exactly our bookmark + OUString expectedFieldName(" PAGEREF "); + expectedFieldName += bookmarkName; + expectedFieldName += " \\h "; + CPPUNIT_ASSERT_EQUAL(expectedFieldName, fieldName); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |