diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-03-05 11:28:23 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-03-09 11:37:27 +0100 |
commit | 45413702b0b71ee56aee57d215b4041d3ea6067b (patch) | |
tree | a6593fb61ae69fd2b34edb164b6ee15997c558a6 /chart2 | |
parent | abe39f7781f59b96c5a8d3dd5b41c60fdf04ad84 (diff) |
tdf#131143 OOXML chart: fix missing data points of scatter chart
If "values-x" property is empty, export X-Y (scatter) chart category
labels in c:xVal/c:strRef/c:strCache/c:pt/c:v to avoid missing data
points at next import.
Change-Id: Ib5ed99bd1186bd1cfa3e2559aff1c8d214547017
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90011
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 13 | ||||
-rw-r--r-- | chart2/qa/extras/data/odt/tdf131143.odt | bin | 0 -> 13970 bytes |
2 files changed, 13 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index c3bd2283bf4e..323a026594d8 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -49,6 +49,7 @@ public: void testCrosses(); void testScatterChartTextXValues(); void testScatterXAxisValues(); + void testScatterXAxisCategories(); void testChartDataTable(); void testChartExternalData(); void testEmbeddingsGrabBag(); @@ -171,6 +172,7 @@ public: CPPUNIT_TEST(testCrosses); CPPUNIT_TEST(testScatterChartTextXValues); CPPUNIT_TEST(testScatterXAxisValues); + CPPUNIT_TEST(testScatterXAxisCategories); CPPUNIT_TEST(testChartDataTable); CPPUNIT_TEST(testChartExternalData); CPPUNIT_TEST(testEmbeddingsGrabBag); @@ -710,6 +712,17 @@ void Chart2ExportTest::testScatterXAxisValues() assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser/c:xVal/c:numRef/c:numCache/c:pt[4]/c:v", "16"); } +void Chart2ExportTest::testScatterXAxisCategories() +{ + load("/chart2/qa/extras/data/odt/", "tdf131143.odt"); + + xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:ptCount", "val", "4"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[1]/c:v", "Row 1"); + assertXPathContent(pXmlDoc, "//c:scatterChart/c:ser[1]/c:xVal/c:strRef/c:strCache/c:pt[2]/c:v", "Row 2"); +} + void Chart2ExportTest::testChartDataTable() { load("/chart2/qa/extras/data/docx/", "testChartDataTable.docx"); diff --git a/chart2/qa/extras/data/odt/tdf131143.odt b/chart2/qa/extras/data/odt/tdf131143.odt Binary files differnew file mode 100644 index 000000000000..e8ffeaf5a962 --- /dev/null +++ b/chart2/qa/extras/data/odt/tdf131143.odt |