chart2/qa/extras/chart2import.cxx | 19 +++++++++++++++++++ chart2/qa/extras/data/xlsx/tdf81396.xlsx |binary 2 files changed, 19 insertions(+)
New commits: commit 9a59068fc31d7150e255ada91c59b8299636f185 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Apr 8 16:59:36 2021 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Apr 8 20:30:21 2021 +0200 tdf#81396: chart2_import: Add unittest Change-Id: Ie5ed55658cf231b59854129792dead1adef2f56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113813 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 59bd6ab2fda2..93596eebc2a0 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -50,6 +50,7 @@ public: void testDOCChartSeries(); void testDOCXChartSeries(); void testDOCXChartEmptySeries(); + void testTdf81396(); void testDOCXChartValuesSize(); void testPPTXChartSeries(); void testPPTXSparseChartSeries(); @@ -185,6 +186,7 @@ public: CPPUNIT_TEST(testDOCChartSeries); CPPUNIT_TEST(testDOCXChartSeries); CPPUNIT_TEST(testDOCXChartEmptySeries); + CPPUNIT_TEST(testTdf81396); CPPUNIT_TEST(testDOCXChartValuesSize); CPPUNIT_TEST(testPPTChartSeries); CPPUNIT_TEST(testPPTXChartSeries); @@ -543,6 +545,23 @@ void Chart2ImportTest::testDOCXChartEmptySeries() CPPUNIT_ASSERT(std::isnan(aValues[2][1])); } +void Chart2ImportTest::testTdf81396() +{ + load(u"/chart2/qa/extras/data/xlsx/", "tdf81396.xlsx"); + Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent), + UNO_QUERY_THROW); + + Reference<chart2::XChartDocument> xChartDoc2(xChartDoc, UNO_QUERY_THROW); + Reference<chart2::XChartType> xChartType(getChartTypeFromDoc(xChartDoc2, 0), UNO_SET_THROW); + std::vector aDataSeriesYValues = getDataSeriesYValuesFromChartType(xChartType); + CPPUNIT_ASSERT_EQUAL(size_t(1), aDataSeriesYValues.size()); + + // Without the fix in place, this test would have failed with + // - Expected: 105.210801910481 + // - Actual : nan + CPPUNIT_ASSERT_EQUAL(105.210801910481, aDataSeriesYValues[0][0]); +} + void Chart2ImportTest::testDOCXChartValuesSize() { load( u"/chart2/qa/extras/data/docx/", "bubblechart.docx" ); diff --git a/chart2/qa/extras/data/xlsx/tdf81396.xlsx b/chart2/qa/extras/data/xlsx/tdf81396.xlsx new file mode 100644 index 000000000000..2a557262a241 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf81396.xlsx differ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits