summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfexport
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-01-07 12:42:17 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-01-07 20:56:05 +0100
commit90cc24d4728dc94a30865d3b3af9409d5967b45a (patch)
treee48072dd42e91f1fb5391fdfd14b8816d3df1747 /sw/qa/extras/odfexport
parent80f3c0ce51a7f94b127fe7c4dd4dd1d87ce694d6 (diff)
tdf#139126: sw_odfexport: Add unittest
Change-Id: I28edbe108989470885fa5a0fe58190c0f3657f53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108934 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r--sw/qa/extras/odfexport/data/tdf139126.odtbin0 -> 11105 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf139126.odt b/sw/qa/extras/odfexport/data/tdf139126.odt
new file mode 100644
index 000000000000..0648f0abedf0
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf139126.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 54dbddf20825..15704c8eeaad 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -232,6 +232,23 @@ DECLARE_ODFEXPORT_TEST(testTdf130314, "tdf130314.docx")
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
+DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ uno::Reference<text::XTextTablesSupplier> xSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xTables = xSupplier->getTextTables();
+ uno::Reference<text::XTextTable> xTable(xTables->getByName("Table1"), uno::UNO_QUERY);
+
+ uno::Reference<text::XTextRange> xD2(xTable->getCellByName("D2"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("4.0"), xD2->getString());
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: ** Expression is faulty **
+ // - Actual : 17976931348623200...
+ uno::Reference<text::XTextRange> xE2(xTable->getCellByName("E2"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("** Expression is faulty **"), xE2->getString());
+}
+
DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getShapes());