[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Sat Feb 27 07:25:03 UTC 2021


 sw/qa/extras/odfexport/data/tdf140437.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx      |   13 +++++++++++++
 2 files changed, 13 insertions(+)

New commits:
commit c5811750c392a6c46bc973de467926d499794dca
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Feb 26 17:18:53 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Sat Feb 27 08:24:28 2021 +0100

    tdf#140437: sw_odfexport: Add unittest
    
    Change-Id: I1d8e2f484069dffe7b635ad6fc41f40f2e626e02
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111652
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/odfexport/data/tdf140437.odt b/sw/qa/extras/odfexport/data/tdf140437.odt
new file mode 100644
index 000000000000..8ed9ee77ce8f
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf140437.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 4e86f035fa92..7e49bbd1b048 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -490,6 +490,19 @@ DECLARE_ODFEXPORT_TEST(testredlineTextFrame, "redlineTextFrame.odt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf140437, "tdf140437.odt")
+{
+    // Without the fix in place, the document would have failed to load
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+    uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+
+    // at least one field should be detected
+    CPPUNIT_ASSERT(xFields->hasMoreElements());
+}
+
 DECLARE_ODFEXPORT_TEST(testTdf131621, "tdf131621.ott")
 {
     CPPUNIT_ASSERT_EQUAL(12, getShapes());


More information about the Libreoffice-commits mailing list