diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf116394.docx | bin | 0 -> 11537 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf116394.docx b/sw/qa/extras/ooxmlexport/data/tdf116394.docx Binary files differnew file mode 100644 index 000000000000..b152a0f3db9b --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf116394.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 47c901dbd32f..b363d261fbf7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -180,6 +180,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123401, "tdf123401.fodt") assertXPathContent(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[4]/w:tc/w:p/w:r[2]/w:instrText", " =AVERAGE(A1:A3)"); } +DECLARE_OOXMLEXPORT_TEST(testTdf116394, "tdf116394.docx") +{ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + + uno::Reference<text::XTextField> xEnumerationAccess(xFields->nextElement(), uno::UNO_QUERY); + + // Without the fix in place, this test would have failed with + // - Expected: ab=cd.. + // - Actual : abcd.. + CPPUNIT_ASSERT_EQUAL(OUString("ab=cd.."), xEnumerationAccess->getPresentation(true).trim()); + + xmlDocUniquePtr pXmlDoc = parseExport(); + if (!pXmlDoc) + return; + assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " MERGEFIELD ab=cd "); +} + DECLARE_OOXMLEXPORT_TEST(testTdf123356, "tdf123356.fodt") { uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); |