chart2/qa/extras/chart2export.cxx | 14 ++++++++++++++ chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx |binary oox/source/export/chartexport.cxx | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit 6df2d48b53946e518a9689c3ea020250652d56be Author: Balazs Varga <balazs.varga...@gmail.com> AuthorDate: Mon Jan 27 11:19:16 2020 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Wed Jan 29 12:01:40 2020 +0100 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 <nem...@numbertext.org> 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 new file mode 100644 index 000000000000..01c6fe56f1c7 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/test3DAreaChartZAxis.xlsx differ 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"; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits