From 9ca4fa05eb5ec7d0d7c3f4a83489013e140d2f0b Mon Sep 17 00:00:00 2001 From: YogeshBharate Date: Fri, 21 Feb 2014 11:03:35 +0530 Subject: fdo#74826: File corruption-Issue related to Series idx & order val. Problem Description: - If the document contains more than one charts together. ex.Bar & Line chart - In that case, LO writes idx & order val equal to 0, instead of 1 for second chart series. - After roundtrip, the document get corrupted. Implementation: - Added varible to take the series count in case of multiple chart. Note: - Some of the UT's are failing when --enable-dbgutil is enabled. Change-Id: I40606b4d69026939fa19ae534dd7b2bb36ec97fc --- oox/source/export/chartexport.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'oox') diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 4250cb72dfbd..9f8df564c5b3 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -438,6 +438,7 @@ sal_Int32 lcl_generateRandomValue() ChartExport::ChartExport( sal_Int32 nXmlNamespace, FSHelperPtr pFS, Reference< frame::XModel >& xModel, XmlFilterBase* pFB, DocumentType eDocumentType ) : DrawingML( pFS, pFB, eDocumentType ) , mnXmlNamespace( nXmlNamespace ) + , mnSeriesCount(0) , maFraction( 1, 576 ) , mxChartModel( xModel ) , mbHasCategoryLabels( sal_False ) @@ -1041,9 +1042,11 @@ void ChartExport::exportPlotArea( ) aCooSysSeq( xBCooSysCnt->getCoordinateSystems()); for( sal_Int32 nCSIdx=0; nCSIdx xCTCnt( aCooSysSeq[nCSIdx], uno::UNO_QUERY ); if( ! xCTCnt.is()) continue; + mnSeriesCount=0; Sequence< Reference< chart2::XChartType > > aCTSeq( xCTCnt->getChartTypes()); for( sal_Int32 nCTIdx=0; nCTIdx xChartType, sal_ // TODO: idx and order pFS->singleElement( FSNS( XML_c, XML_idx ), - XML_val, I32S(nSeriesIdx), + XML_val, I32S(mnSeriesCount), FSEND ); pFS->singleElement( FSNS( XML_c, XML_order ), - XML_val, I32S(nSeriesIdx), + XML_val, I32S(mnSeriesCount++), FSEND ); // export label -- cgit