diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-03-12 15:19:37 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-03-13 10:21:16 +0100 |
commit | afe0a7ec1f0a3841c96148f17c9616b861c08582 (patch) | |
tree | a9e8b5cb9fc57a0b77ffd87c49a84a485d137624 | |
parent | 6bcbcb21faed17e529591f29aa0e492600f49ec3 (diff) |
handle MSO 2007 vs OOXML in auto title chart import
Conflicts:
oox/source/drawingml/chart/chartspacefragment.cxx
oox/source/drawingml/chart/chartspacemodel.cxx
Change-Id: Ie143751d22404dac8f31c8ecef90a0e185e07973
-rw-r--r-- | include/oox/drawingml/chart/chartspacemodel.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/chartspacefragment.cxx | 7 | ||||
-rw-r--r-- | oox/source/drawingml/chart/chartspacemodel.cxx | 8 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 3 |
4 files changed, 12 insertions, 8 deletions
diff --git a/include/oox/drawingml/chart/chartspacemodel.hxx b/include/oox/drawingml/chart/chartspacemodel.hxx index cc9015d2020a..1a44943275bb 100644 --- a/include/oox/drawingml/chart/chartspacemodel.hxx +++ b/include/oox/drawingml/chart/chartspacemodel.hxx @@ -58,7 +58,7 @@ struct ChartSpaceModel bool mbShowLabelsOverMax;/// True = show labels over chart maximum. bool mbPivotChart; /// True = pivot chart. - explicit ChartSpaceModel(); + explicit ChartSpaceModel(bool bMSO2007Doc); ~ChartSpaceModel(); }; diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index eec0f1c79bb7..4818bad0a7cb 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -85,8 +85,13 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const switch( nElement ) { case C_TOKEN( autoTitleDeleted ): - mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, true ); + { + bool bMSO2007Document = getFilter().isMSO2007Document(); + + // default value is false for MSO 2007 and true in OOXML + mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, !bMSO2007Document ); return 0; + } case C_TOKEN( backWall ): return new WallFloorContext( *this, mrModel.mxBackWall.create() ); case C_TOKEN( dispBlanksAs ): diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index d6e920d85488..b76a55c36a38 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -23,12 +23,10 @@ namespace oox { namespace drawingml { namespace chart { - - -ChartSpaceModel::ChartSpaceModel() : - mnDispBlanksAs( XML_gap ), // not zero as specified +ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : + mnDispBlanksAs( XML_gap ), // not zero as specified, TODO: OOXML_spec mnStyle( 2 ), - mbAutoTitleDel( true ), + mbAutoTitleDel( !bMSO2007Doc ), // difference between OOXML spec and MSO 2007 mbPlotVisOnly( false ), mbShowLabelsOverMax( false ), mbPivotChart( false ) diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index ef0feb770dbb..05bff1a927c9 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1249,7 +1249,8 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >& Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW ); // load the chart data from the XML fragment - chart::ChartSpaceModel aModel; + bool bMSO2007Doc = rFilter.isMSO2007Document(); + chart::ChartSpaceModel aModel(bMSO2007Doc); chart::ChartSpaceFragment *pChartSpaceFragment = new chart::ChartSpaceFragment( rFilter, mxChartShapeInfo->maFragmentPath, aModel ); const OUString aThemeOverrideFragmentPath( pChartSpaceFragment-> |