xmloff/source/chart/SchXMLExport.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 9239dc026ae31d38e495c7031b1e55cab4aebe9a
Author: Vinaya Mandke <vinaya.man...@synerzip.com>
Date:   Wed Oct 23 14:25:19 2013 +0530

        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 <markus.mohrh...@googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/xmloff/source/chart/SchXMLExport.cxx 
b/xmloff/source/chart/SchXMLExport.cxx
index aa05e7b..533c873 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 );
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to