[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - include/oox oox/source

Markus Mohrhard markus.mohrhard at googlemail.com
Wed Jan 17 08:58:07 UTC 2018


 include/oox/export/chartexport.hxx |    2 +-
 oox/source/export/chartexport.cxx  |   24 ++++++++++++++++++++++--
 2 files changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 0387e8710dce75f98d3c6084fa69126a04d27f74
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Dec 28 01:04:27 2017 +0100

    export explosion property for pie chart property, tdf#114182
    
    Change-Id: I02b46929db1bfbff32e7b1228186079b868e7971
    Reviewed-on: https://gerrit.libreoffice.org/47154
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    (cherry picked from commit 629cfd2c1d3a43048fdb87853fa886b19105a786)
    Reviewed-on: https://gerrit.libreoffice.org/47164
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 755661f5ddd7..e1ae1f4f0a9b 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -175,7 +175,7 @@ private:
     void exportTextProps(const css::uno::Reference< css::beans::XPropertySet >& xPropSet);
     void exportDataPoints(
         const css::uno::Reference< css::beans::XPropertySet >& xSeriesProperties,
-        sal_Int32 nSeriesLength );
+        sal_Int32 nSeriesLength, sal_Int32 eChartType );
     void exportDataLabels( const css::uno::Reference<css::chart2::XDataSeries>& xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType );
     void exportGrouping( bool isBar = false );
     void exportTrendlines( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 0a63f791b347..cf00594d23c1 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1972,7 +1972,7 @@ void ChartExport::exportSeries( const Reference<chart2::XChartType>& xChartType,
                     }
 
                     // export data points
-                    exportDataPoints( uno::Reference< beans::XPropertySet >( rSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength );
+                    exportDataPoints( uno::Reference< beans::XPropertySet >( rSeriesSeq[nSeriesIdx], uno::UNO_QUERY ), nSeriesLength, eChartType );
 
                     // export data labels
                     exportDataLabels(rSeriesSeq[nSeriesIdx], nSeriesLength, eChartType);
@@ -3002,7 +3002,7 @@ void ChartExport::exportDataLabels(
 
 void ChartExport::exportDataPoints(
     const uno::Reference< beans::XPropertySet > & xSeriesProperties,
-    sal_Int32 nSeriesLength )
+    sal_Int32 nSeriesLength, sal_Int32 eChartType )
 {
     uno::Reference< chart2::XDataSeries > xSeries( xSeriesProperties, uno::UNO_QUERY );
     bool bVaryColorsByPoint = false;
@@ -3055,6 +3055,26 @@ void ChartExport::exportDataPoints(
                 pFS->singleElement( FSNS( XML_c, XML_idx ),
                     XML_val, I32S(nElement),
                     FSEND );
+
+                switch (eChartType)
+                {
+                    case chart::TYPEID_PIE:
+                    case chart::TYPEID_DOUGHNUT:
+                    {
+                        if( xPropSet.is() && GetProperty( xPropSet, "SegmentOffset") )
+                        {
+                            sal_Int32 nOffset = 0;
+                            mAny >>= nOffset;
+                            if (nOffset)
+                                pFS->singleElement( FSNS( XML_c, XML_explosion ),
+                                        XML_val, I32S( nOffset ),
+                                        FSEND );
+                        }
+                        break;
+                    }
+                    default:
+                        break;
+                }
                 exportShapeProps( xPropSet );
 
                 pFS->endElement( FSNS( XML_c, XML_dPt ) );


More information about the Libreoffice-commits mailing list