From f684c074d5f66c8b1546a626766bc045c04cebc3 Mon Sep 17 00:00:00 2001 From: László Németh Date: Mon, 11 Mar 2019 16:30:36 +0100 Subject: tdf#115012 XLSX chart import: workaround for no gap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- chart2/qa/extras/chart2export.cxx | 11 +++++++++++ chart2/qa/extras/data/xlsx/tdf115012.xlsx | Bin 0 -> 13729 bytes 2 files changed, 11 insertions(+) create mode 100644 chart2/qa/extras/data/xlsx/tdf115012.xlsx (limited to 'chart2') 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 new file mode 100644 index 000000000000..cf8ac7d81eac Binary files /dev/null and b/chart2/qa/extras/data/xlsx/tdf115012.xlsx differ -- cgit