[Libreoffice-commits] core.git: oox/source

Katarina Behrens bubli at bubli.org
Sun Feb 17 05:35:50 PST 2013


 oox/source/export/chartexport.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 1aadb8789bc9a58e1798c0905214833a0cd6d40e
Author: Katarina Behrens <bubli at bubli.org>
Date:   Sun Feb 17 14:29:51 2013 +0100

    fdo#58789: export field separators, fix series name display
    
    Change-Id: I1edae1c2ec845a46d7a9a4ab2517784d2d68d51d

diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index ebeafc2..2d24717 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2293,12 +2293,13 @@ void ChartExport::exportDataLabels(
 {
     // TODO: export field separators, missing flag vs. showing series name or not
     uno::Reference< chart2::XDataSeries > xSeries( xSeriesProperties, uno::UNO_QUERY );
-    Sequence< sal_Int32 > aDataPointSeq;
+
     if( xSeriesProperties.is())
     {
         FSHelperPtr pFS = GetFS();
         pFS->startElement( FSNS( XML_c, XML_dLbls ),
                     FSEND );
+
         sal_Int32 nElem;
         for( nElem = 0; nElem < nSeriesLength; ++nElem)
         {
@@ -2327,6 +2328,7 @@ void ChartExport::exportDataLabels(
                    namespace csscd = ::com::sun::star::chart::DataLabelPlacement;
                    sal_Int32 nPlacement(csscd::AVOID_OVERLAP);
                    const char *aPlacement = NULL;
+                   OUString aSep;
 
                    if (GetProperty( xPropSet, "LabelPlacement"))
                        mAny >>= nPlacement;
@@ -2347,6 +2349,13 @@ void ChartExport::exportDataLabels(
                    pFS->startElement( FSNS( XML_c, XML_dLbl ), FSEND);
                    pFS->singleElement( FSNS( XML_c, XML_idx), XML_val, I32S(nElem), FSEND);
                    pFS->singleElement( FSNS( XML_c, XML_dLblPos), XML_val, aPlacement, FSEND);
+
+                   if (GetProperty( xPropSet, "LabelSeparator"))
+                   {
+                       mAny >>= aSep;
+                       pFS->singleElement( FSNS( XML_c, XML_separator), XML_val, USS(aSep), FSEND);
+                   }
+
                    pFS->singleElement( FSNS( XML_c, XML_showLegendKey), XML_val,
                                        aLabel.ShowLegendSymbol ? "1" : "0", FSEND);
                    pFS->singleElement( FSNS( XML_c, XML_showVal), XML_val,
@@ -2355,6 +2364,10 @@ void ChartExport::exportDataLabels(
                                        aLabel.ShowCategoryName ? "1" : "0", FSEND);
                    pFS->singleElement( FSNS( XML_c, XML_showPercent), XML_val,
                                        aLabel.ShowNumberInPercent ? "1" : "0", FSEND);
+                   // MSO somehow assumes series name to be on (=displayed) by default.
+                   // Let's put false here and switch it off then, since we have no UI means
+                   // in LibO to toggle it on anyway
+                   pFS->singleElement( FSNS( XML_c, XML_showSerName), XML_val, "0", FSEND);
                    pFS->endElement( FSNS( XML_c, XML_dLbl ));
                }
             }


More information about the Libreoffice-commits mailing list