From a3881a66b8ffda4a8a89ecfc4347555e34193665 Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Tue, 2 Apr 2019 16:10:00 +0200 Subject: [PATCH] tdf#124466 XLSX: fix broken export by removing chart type data redundancy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XLSX import created a redundant series container for data series with the same chart type, when they were attached to a different axis. Modifying the loaded chart by the user, ie. attaching one of its data series to a different axis resulted broken OOXML export later, because based on the new axis, splitDataSeriesByAxis splitted the first or the redundant series container further. Now the import creates only a single series container for the series with the same chart type, preventing potential export problems. Change-Id: If951feaca3cb3b5df7718e9d7bfd59620ef3c4d3 Reviewed-on: https://gerrit.libreoffice.org/70141 Reviewed-by: László Németh Tested-by: László Németh --- chart2/qa/extras/chart2export.cxx | 21 ++++++++++++++++++ .../data/xlsx/add_series_secondary_axis.xlsx | Bin 0 -> 20217 bytes .../drawingml/chart/typegroupconverter.cxx | 19 ++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100755 chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 3d537cf2ab90..6c769f0bbe63 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -113,6 +113,7 @@ public: void testBarChartVaryColorsXLSX(); void testMultipleAxisXLSX(); void testSecondaryAxisXLSX(); + void testSetSeriesToSecondaryAxisXLSX(); void testAxisTitleRotationXLSX(); void testAxisCrossBetweenXSLX(); void testPieChartDataPointExplosionXLSX(); @@ -206,6 +207,7 @@ public: CPPUNIT_TEST(testBarChartVaryColorsXLSX); CPPUNIT_TEST(testMultipleAxisXLSX); CPPUNIT_TEST(testSecondaryAxisXLSX); + CPPUNIT_TEST(testSetSeriesToSecondaryAxisXLSX); CPPUNIT_TEST(testAxisTitleRotationXLSX); CPPUNIT_TEST(testAxisCrossBetweenXSLX); CPPUNIT_TEST(testPieChartDataPointExplosionXLSX); @@ -1760,6 +1762,25 @@ void Chart2ExportTest::testSecondaryAxisXLSX() assertXPathContent(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart[2]/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v", "a"); } +void Chart2ExportTest::testSetSeriesToSecondaryAxisXLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "add_series_secondary_axis.xlsx"); + Reference< chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + // Second series + Reference xSeries = getDataSeriesFromDoc(xChartDoc, 1); + CPPUNIT_ASSERT(xSeries.is()); + + Reference xPropSet(xSeries, uno::UNO_QUERY_THROW); + sal_Int32 AxisIndex = 1; + // Attach the second series to the secondary axis. (The third series is already attached.) + xPropSet->setPropertyValue("AttachedAxisIndex", uno::Any(AxisIndex)); + + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + // Check there are only two tag in the XML, one for the primary and one for the secondary axis. + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:lineChart", 2); +} + void Chart2ExportTest::testAxisTitleRotationXLSX() { load("/chart2/qa/extras/data/xlsx/", "axis_title_rotation.xlsx"); diff --git a/chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx b/chart2/qa/extras/data/xlsx/add_series_secondary_axis.xlsx new file mode 100755 index 0000000000000000000000000000000000000000..03d7a47f6c3dab66466d4c6205d7478c95edbff3 GIT binary patch literal 20217 zcmeHvWmFy6wl41O1a}DT?gV!T5Zv9}-95Mm4Z+=lLvVL@_uvk1clx}Obh__-@BY4L zGYY6tdwrwks&B3-YtE9F0tG_@f&hX70s^D54S>I#h%ZHhV4K$z#w3A9>c!j$T&OwOMjzLJ#kxOvF28>F*3rViwmoRj zpcQm;tE2)&4~7!b0~MH6ZYnDsKV7&5_r{OpVONF4G22TH67!T-w^_gES`$jb1}4sg zTc0!=%Qe^*6_MA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v=0LGjEAgyY}QJom9kJ- zR14V{SXP$UZTBK+bgJ~~9=DHua5-?szXxLOVa+yaN8%@}l|c4v7AIPyERtZuh_4zs_%qe--+88qJDf-hN{ z>=b;mLnUAb*Kj0mulgBmP-lp2@%V}WGp|56CLASfw{IPUO+ddXT8>V{F29rc1@TKg z4258~5dD3gtzl=K>A=RF%x?Q8{llS0`p?~4U=UhBL+wAmuIHyp{Q2KMyu3$V>aPHQ zec#7l003K@zr6k9_kn+X>%p%BnE`3d|N0#WzvKMgZ~-k905N{=@ckX&_jaV80J(s^=YMtV|98zvzXSf>;qwzP8?ZwU z0Q~oc^Pf-W*KOw?S)ktmfA5<437CoT1Mpuv{(r*#EE)Vqu-|)5eu9-^{s8;gf%5x( z{9fGubEx;5-)HJ)ssHaNzgKVnMA^dqRhpl*+`l9IUM~3)p_b@Zgr76xIT{5!y3HyeHh@Mr!N z;Gec0e#iQ2%KBHVP}YCO`kBD~9qX@o&tI`(0IgyFv?cO03;H|OUz2CQVkL3@iuLb} zmEQsWnq>MFpn?nV+LynloPG!RYkJ{VfE%9Q@8D;$;dhk3Mz+7Abn^X<@?&Oy2l#8m z_$xp$z=r>v)ITQT$8G#0%3tH8Ur`XA4T}#W5`Q^1KN#%fN%gmYyj(2CichK{{iRFj|%_* literal 0 HcmV?d00001 diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 1f6c73e11d0b..bd592e6adbc5 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -312,6 +312,10 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra OUString aService = OUString::createFromAscii( maTypeInfo.mpcServiceName ); Reference< XChartType > xChartType( createInstance( aService ), UNO_QUERY_THROW ); + Reference< XChartTypeContainer > xChartTypeContOld( rxCoordSystem, UNO_QUERY_THROW ); + Sequence< Reference< XChartType > > xOldChartTypes( xChartTypeContOld->getChartTypes() ); + sal_Int32 nOldChartTypeIdx = -1; + // additional properties PropertySet aDiaProp( rxDiagram ); PropertySet aTypeProp( xChartType ); @@ -419,11 +423,19 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra } else { + for( sal_Int32 nCTIdx=0; nCTIdxgetChartType() == xOldChartTypes[nCTIdx]->getChartType() ) + { + nOldChartTypeIdx = nCTIdx; + } + } + for (auto const& elem : aSeries) { SeriesConverter& rSeriesConv = *elem; Reference< XDataSeries > xDataSeries = rSeriesConv.createDataSeries( *this, bVaryColorsByPoint ); - insertDataSeries( xChartType, xDataSeries, nAxesSetIdx ); + insertDataSeries( nOldChartTypeIdx == -1 ? xChartType : xOldChartTypes[nOldChartTypeIdx], xDataSeries, nAxesSetIdx ); /* Excel does not use the value of the c:smooth element of the chart type to set a default line smoothing for the data @@ -440,7 +452,10 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra // add chart type object to coordinate system Reference< XChartTypeContainer > xChartTypeCont( rxCoordSystem, UNO_QUERY_THROW ); - xChartTypeCont->addChartType( xChartType ); + if (nOldChartTypeIdx == -1) + { + xChartTypeCont->addChartType(xChartType); + } // set existence of bar connector lines at diagram (only in stacked 2D bar charts) if( mrModel.mxSerLines.is() && !mb3dChart && (maTypeInfo.meTypeCategory == TYPECATEGORY_BAR) && (isStacked() || isPercent()) )