From 9239dc026ae31d38e495c7031b1e55cab4aebe9a Mon Sep 17 00:00:00 2001 From: Vinaya Mandke Date: Wed, 23 Oct 2013 14:25:19 +0530 Subject: Fix for Chart Series Names For Docx files, the chart series names (labels) were rendered incorrectly and hence exported incorrectly. In place of the correct label, the series name for next series was displayed. Change-Id: I988571d76d9c706ac2f7693881198bb604ec3fa8 Change-Id: I52631bc62fce46a43298c284cb11c2e8916fabe3 Reviewed-on: https://gerrit.libreoffice.org/6350 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- xmloff/source/chart/SchXMLExport.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index aa05e7b225a2..533c873a08b3 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2589,6 +2589,7 @@ void SchXMLExportHelper_Impl::exportSeries( OUString aFirstXDomainRange; OUString aFirstYDomainRange; + bool modifyLabelRange = false; std::vector< XMLPropertyState > aPropertyStates; @@ -2734,11 +2735,17 @@ void SchXMLExportHelper_Impl::exportSeries( // #i75297# allow empty series, export empty range to have all ranges on import mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_VALUES_CELL_RANGE_ADDRESS, OUString()); - if( xLabelSeq.is()) + if( xLabelSeq.is()) { + OUString aRange = xLabelSeq->getSourceRangeRepresentation(); + if ( nSeriesIdx == 0 && aRange.compareToAscii("label 1") == 0) + modifyLabelRange = true; + if (modifyLabelRange) + aRange = OUString("label ") + OUString::number(aRange.copy( OUString("label").getLength()).toInt32() - 1); mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_LABEL_CELL_ADDRESS, lcl_ConvertRange( - xLabelSeq->getSourceRangeRepresentation(), + aRange, xNewDoc )); + } if( xLabelSeq.is() || xValuesSeq.is() ) aSeriesLabelValuesPair = tLabelValuesDataPair( xLabelSeq, xValuesSeq ); -- cgit