diff options
author | YogeshBharate <yogesh.bharate@synerzip.com> | 2013-12-11 18:01:27 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-12-13 20:48:31 +0100 |
commit | 077213c23e377fd7398b35b88050ac173d22d268 (patch) | |
tree | aa57b482374c66dbd6918d67cf8f55171456ffc5 | |
parent | 122d6c5e975cfbc03f55205a33d5d91e4cbc0906 (diff) |
fdo#72345: Fixed for Charts - Up Down Bars are missing after Round trip
UpDownBars missing after Roundtrip in case of LineChart.
Change-Id: Ia3e574aefb9436a2f5b2b88e8824625d09d35c38
-rw-r--r-- | include/oox/export/chartexport.hxx | 1 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 52 |
2 files changed, 37 insertions, 16 deletions
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx index 237b410c686d..833b90a2efa9 100644 --- a/include/oox/export/chartexport.hxx +++ b/include/oox/export/chartexport.hxx @@ -130,6 +130,7 @@ private: void exportScatterChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType ); void exportStockChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType ); void exportSuffaceChart( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType ); + void exportUpDownBars(com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType ); void exportSeries( com::sun::star::uno::Reference< com::sun::star::chart2::XChartType > xChartType, sal_Int32& nAttachedAxis ); void exportCandleStickSeries( diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 9655f3e6154d..095203fbdb92 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1252,6 +1252,7 @@ void ChartExport::exportLineChart( Reference< chart2::XChartType > xChartType ) FSEND ); } + exportUpDownBars(xChartType); exportAxesId( nAttachedAxis ); pFS->endElement( FSNS( XML_c, nTypeId ) ); @@ -1355,38 +1356,57 @@ void ChartExport::exportStockChart( Reference< chart2::XChartType > xChartType ) exportShapeProps( xStockPropSet ); pFS->endElement( FSNS( XML_c, XML_hiLowLines ) ); } - // stock updownbar + exportUpDownBars(xChartType); + } + + exportAxesId( nAttachedAxis ); + + pFS->endElement( FSNS( XML_c, XML_stockChart ) ); +} + +void ChartExport::exportUpDownBars( Reference< chart2::XChartType > xChartType) +{ + FSHelperPtr pFS = GetFS(); + // export the chart property + Reference< ::com::sun::star::chart::XStatisticDisplay > xChartPropProvider( mxDiagram, uno::UNO_QUERY ); + if(xChartPropProvider.is()) + { + Reference< beans::XPropertySet > xChartPropSet = xChartPropProvider->getMinMaxLine(); + // updownbar pFS->startElement( FSNS( XML_c, XML_upDownBars ), FSEND ); // TODO: gapWidth sal_Int32 nGapWidth = 150; pFS->singleElement( FSNS( XML_c, XML_gapWidth ), - XML_val, I32S( nGapWidth ), - FSEND ); + XML_val, I32S( nGapWidth ), + FSEND ); - xStockPropSet = xStockPropProvider->getUpBar(); - if( xStockPropSet.is() ) + xChartPropSet = xChartPropProvider->getUpBar(); + if( xChartPropSet.is() ) { pFS->startElement( FSNS( XML_c, XML_upBars ), - FSEND ); - exportShapeProps( xStockPropSet ); + FSEND ); + // For Linechart with UpDownBars, spPr is not getting imported + // so no need to call the exportShapeProps() for LineChart + if(xChartType->getChartType().equals("com.sun.star.chart2.CandleStickChartType")) + { + exportShapeProps(xChartPropSet); + } pFS->endElement( FSNS( XML_c, XML_upBars ) ); } - - xStockPropSet = xStockPropProvider->getDownBar(); - if( xStockPropSet.is() ) + xChartPropSet = xChartPropProvider->getDownBar(); + if( xChartPropSet.is() ) { pFS->startElement( FSNS( XML_c, XML_downBars ), - FSEND ); - exportShapeProps( xStockPropSet ); + FSEND ); + if(xChartType->getChartType().equals("com.sun.star.chart2.CandleStickChartType")) + { + exportShapeProps(xChartPropSet); + } pFS->endElement( FSNS( XML_c, XML_downBars ) ); } pFS->endElement( FSNS( XML_c, XML_upDownBars ) ); } - - exportAxesId( nAttachedAxis ); - - pFS->endElement( FSNS( XML_c, XML_stockChart ) ); } void ChartExport::exportSuffaceChart( Reference< chart2::XChartType > xChartType ) |