sw/qa/extras/odfexport/data/tdf139126.odt |binary sw/qa/extras/odfexport/odfexport.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+)
New commits: commit 90cc24d4728dc94a30865d3b3af9409d5967b45a Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Jan 7 12:42:17 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Jan 7 20:56:05 2021 +0100 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 <xiscofa...@libreoffice.org> 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 Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf139126.odt 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()); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits