diff options
author | László Németh <nemeth@numbertext.org> | 2019-03-11 16:30:36 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-03-12 13:16:00 +0100 |
commit | f684c074d5f66c8b1546a626766bc045c04cebc3 (patch) | |
tree | 0178d1ba6514a79effff58dbcc6a9320ff781f3b /chart2 | |
parent | adb08e892b37ea9e155abbdee4e0c9951a1d163b (diff) |
tdf#115012 XLSX chart import: workaround for no gap
DispBlanksAs=gap mode of OOXML is different from
treat-empty-cells=leave-gap mode of OpenDocument,
because formulas with no numerical values and
strings are no gaps in OOXML line charts, but zeroes.
When the data source of the line charts contains
formulas with no numerical values or strings,
but it doesn't contain empty cells, as a workaround,
the charts will be imported with the
treat-empty-cells=use-zero setting to get the same
line chart as in MSO.
Note: now result of ScChart2DataSequence::getData(),
a sequence of Any values contains UNO void values for
empty cells instead empty strings, allowing the
distinction of the empty cells and cells with empty
string values.
Change-Id: If9a101d66b5b750051928fa7b10b05cea6040071
Reviewed-on: https://gerrit.libreoffice.org/69054
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 11 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/tdf115012.xlsx | bin | 0 -> 13729 bytes |
2 files changed, 11 insertions, 0 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 8671a4771e21..f4d8f5e981a9 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -128,6 +128,7 @@ public: void testTdf108022(); void testTdf121744(); void testTdf122031(); + void testTdf115012(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -219,6 +220,7 @@ public: CPPUNIT_TEST(testTdf108022); CPPUNIT_TEST(testTdf121744); CPPUNIT_TEST(testTdf122031); + CPPUNIT_TEST(testTdf115012); CPPUNIT_TEST_SUITE_END(); protected: @@ -2046,6 +2048,15 @@ void Chart2ExportTest::testTdf122031() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:pieChart/c:ser/c:dLbls/c:dLbl[3]/c:numFmt", "formatCode", "0.000%"); } +void Chart2ExportTest::testTdf115012() +{ + load("/chart2/qa/extras/data/xlsx/", "tdf115012.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart","Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + // workaround: use-zero instead of leave-gap to show the original line chart + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:dispBlanksAs", "val", "zero"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/tdf115012.xlsx b/chart2/qa/extras/data/xlsx/tdf115012.xlsx Binary files differnew file mode 100644 index 000000000000..cf8ac7d81eac --- /dev/null +++ b/chart2/qa/extras/data/xlsx/tdf115012.xlsx |