diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2020-01-27 11:19:16 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-01-29 12:01:40 +0100 |
commit | 6df2d48b53946e518a9689c3ea020250652d56be (patch) | |
tree | b0ea1410dd42bee41d28f6076a3c75ba2d1b0114 | |
parent | 9600a5abc93406bd966507edda3f66ef599fc8d7 (diff) |
tdf#130237 OOXML chart export: fix incomplete 3D area chart
by exporting its z-axis properties into <serAx> element.
Data series of 3D area charts were “transparent” or incomplete
opening with MSO, because we exported z-axis as a category axis.
Change-Id: If7d8c15aa738cc44c736cd37d2be30d0eb15538f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87506
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
-rw-r--r-- | chart2/qa/extras/chart2export.cxx | 14 | ||||
-rw-r--r-- | chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx | bin | 0 -> 15501 bytes | |||
-rw-r--r-- | oox/source/export/chartexport.cxx | 2 |
3 files changed, 15 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index ea19e9d2ad0a..5ee135f5920b 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -145,6 +145,7 @@ public: void testMultipleCategoryAxisLablesDOCX(); void testTdf116163(); void testTdf111824(); + void test3DAreaChartZAxis(); void testTdf119029(); void testTdf108022(); void testTdf121744(); @@ -260,6 +261,7 @@ public: CPPUNIT_TEST(testMultipleCategoryAxisLablesDOCX); CPPUNIT_TEST(testTdf116163); CPPUNIT_TEST(testTdf111824); + CPPUNIT_TEST(test3DAreaChartZAxis); CPPUNIT_TEST(testTdf119029); CPPUNIT_TEST(testTdf108022); CPPUNIT_TEST(testTdf121744); @@ -2344,6 +2346,18 @@ void Chart2ExportTest::testTdf111824() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:serAx/c:axId", "val", zAxisIdOf3DBarchart); } +void Chart2ExportTest::test3DAreaChartZAxis() +{ + load("/chart2/qa/extras/data/xlsx/", "test3DAreaChartZAxis.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + + // Collect 3D area chart Z axID + OUString zAxisIdOf3DAreachart = getXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:area3DChart/c:axId[3]", "val"); + // 3D area chart z-axis properties should be in a serAx OOXML element instead of catAx + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:serAx/c:axId", "val", zAxisIdOf3DAreachart); +} + void Chart2ExportTest::testTdf119029() { load("/chart2/qa/extras/data/odp/", "tdf119029.odp"); diff --git a/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx b/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx Binary files differnew file mode 100644 index 000000000000..01c6fe56f1c7 --- /dev/null +++ b/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 46dc2285f839..8debc8d047c3 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2756,7 +2756,7 @@ void ChartExport::exportAxis(const AxisIdPair& rAxisIdPair) nAxisType = XML_valAx; else if( eChartType == chart::TYPEID_STOCK ) nAxisType = XML_dateAx; - else if( eChartType == chart::TYPEID_BAR ) + else if( eChartType == chart::TYPEID_BAR || eChartType == chart::TYPEID_AREA ) nAxisType = XML_serAx; // FIXME: axPos, need to check axis direction sAxPos = "b"; |