summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-12-28 01:04:27 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-12-29 01:34:08 +0100
commit629cfd2c1d3a43048fdb87853fa886b19105a786 (patch)
treef95a8b691987bf5eb80f64f91a842b02210d0327
parent367b10fb833aa854c2c52c91757c40bdd10be97d (diff)
export explosion property for pie chart property, tdf#114182
Change-Id: I02b46929db1bfbff32e7b1228186079b868e7971 Reviewed-on: https://gerrit.libreoffice.org/47154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--include/oox/export/chartexport.hxx2
-rw-r--r--oox/source/export/chartexport.cxx24
2 files changed, 23 insertions, 3 deletions
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 6b1e9f8fadde..4ac5ee10bb2b 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -176,7 +176,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 f0d639a497a3..83b96fb0f518 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1960,7 +1960,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);
@@ -2992,7 +2992,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;
@@ -3045,6 +3045,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 ) );