sw/qa/extras/ooxmlexport/data/tdf148052.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+)
New commits: commit bc227a15db04e218f34c6e2055c05b3cee67e4cf Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Apr 11 10:48:21 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Apr 11 15:36:56 2022 +0200 tdf#148052: sw_ooxmlexport17: add unittest Change-Id: I4153e4598114e54481fc25d174c3ccb9394de6b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132811 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf148052.docx b/sw/qa/extras/ooxmlexport/data/tdf148052.docx new file mode 100644 index 000000000000..4e0dad0f5bee Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148052.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index 77caab6f81ff..e592e376336e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -350,6 +350,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf146851_2, "tdf146851_2.docx") CPPUNIT_ASSERT_EQUAL(OUString("Schedule"), xTextField->getPresentation(false)); } +DECLARE_OOXMLEXPORT_TEST(testTdf148052, "tdf148052.docx") +{ + uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields()); + + uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); + CPPUNIT_ASSERT(xFields->hasMoreElements()); + + uno::Reference<text::XTextField> xTextField(xFields->nextElement(), uno::UNO_QUERY); + + // Without the fix in place, this test would have failed with + // - Expected: 14. Aug 18 + // - Actual : 11. Apr 22 + CPPUNIT_ASSERT_EQUAL(OUString("14. Aug 18"), xTextField->getPresentation(false)); +} + DECLARE_OOXMLEXPORT_TEST(testTdf148111, "tdf148111.docx") { uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);