summaryrefslogtreecommitdiff
path: root/chart2/qa
diff options
context:
space:
mode:
authorJean-Tiare Le Bigot <admin@jtlebi.fr>2016-10-13 23:43:41 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-11-06 06:02:27 +0000
commit4bcf1872bbe9db1388769485a7e4c0cbcce3d53c (patch)
tree0110875cf6db25b7208099e9394995254111b221 /chart2/qa
parent17e9dc436bc6ad8d3a5bbde15d4d47262650aa2c (diff)
chartx: fix sparse chart import
Change-Id: I1bcd2257da900c6a88bc78040fabe5696e2bab7d Reviewed-on: https://gerrit.libreoffice.org/29801 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2/qa')
-rw-r--r--chart2/qa/extras/chart2import.cxx24
-rwxr-xr-xchart2/qa/extras/data/pptx/sparse-chart.pptxbin0 -> 57398 bytes
2 files changed, 24 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index c8137b9ac6ff..b508f3e123dd 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -40,6 +40,7 @@ public:
void testDOCChartSeries();
void testDOCXChartSeries();
void testPPTXChartSeries();
+ void testPPTXSparseChartSeries();
/**
* Original data contains 3 series but 2 of them are hidden. For now, we
* detect and skip those hidden series on import (since we don't support
@@ -105,6 +106,7 @@ public:
CPPUNIT_TEST(testDOCXChartSeries);
CPPUNIT_TEST(testPPTChartSeries);
CPPUNIT_TEST(testPPTXChartSeries);
+ CPPUNIT_TEST(testPPTXSparseChartSeries);
CPPUNIT_TEST(testPPTXHiddenDataSeries);
CPPUNIT_TEST(testPPTXPercentageNumberFormats);
CPPUNIT_TEST(testPPTXStackedNonStackedYAxis);
@@ -399,6 +401,28 @@ void Chart2ImportTest::testPPTXChartSeries()
CPPUNIT_ASSERT_EQUAL(OUString("Column 3"), aLabels[2][0].get<OUString>());
}
+void Chart2ImportTest::testPPTXSparseChartSeries()
+{
+ //test chart series sparse data for pptx
+ load("/chart2/qa/extras/data/pptx/", "sparse-chart.pptx");
+ Reference<chart2::XChartDocument> xChartDoc(getChartDocFromDrawImpress(0, 0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference<chart2::XChartType> xCT = getChartTypeFromDoc(xChartDoc, 0);
+ CPPUNIT_ASSERT(xCT.is());
+
+ std::vector<std::vector<double> > aValues = getDataSeriesYValuesFromChartType(xCT);
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aValues.size());
+ CPPUNIT_ASSERT_EQUAL(0.0, aValues[0][0]);
+ CPPUNIT_ASSERT_EQUAL(2.5, aValues[0][1]);
+ CPPUNIT_ASSERT_EQUAL(3.5, aValues[0][2]);
+ CPPUNIT_ASSERT_EQUAL(0.0, aValues[0][3]);
+ CPPUNIT_ASSERT_EQUAL(-2.4, aValues[1][0]);
+ CPPUNIT_ASSERT_EQUAL(0.0, aValues[1][1]);
+ CPPUNIT_ASSERT_EQUAL(0.0, aValues[1][2]);
+ CPPUNIT_ASSERT_EQUAL(-2.8, aValues[1][3]);
+}
+
void Chart2ImportTest::testPPTXHiddenDataSeries()
{
load("/chart2/qa/extras/data/pptx/", "stacked-bar-chart-hidden-series.pptx");
diff --git a/chart2/qa/extras/data/pptx/sparse-chart.pptx b/chart2/qa/extras/data/pptx/sparse-chart.pptx
new file mode 100755
index 000000000000..d91e8f52f40a
--- /dev/null
+++ b/chart2/qa/extras/data/pptx/sparse-chart.pptx
Binary files differ