summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorYogeshBharate <yogesh.bharate@synerzip.com>2013-12-11 18:01:27 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-12-13 20:48:31 +0100
commit077213c23e377fd7398b35b88050ac173d22d268 (patch)
treeaa57b482374c66dbd6918d67cf8f55171456ffc5 /oox
parent122d6c5e975cfbc03f55205a33d5d91e4cbc0906 (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
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx52
1 files changed, 36 insertions, 16 deletions
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 )