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 <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2022-04-11 10:48:21 +02:00
parent bb64cd2884
commit bc227a15db
2 changed files with 16 additions and 0 deletions

Binary file not shown.

View File

@@ -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);