summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/oox/export/chartexport.hxx1
-rw-r--r--oox/source/export/chartexport.cxx52
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 )