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-12 15:22:35 +0100 |
commit | ca698a076f017a73c8c6f27f57139b3e350f0f6b (patch) | |
tree | d9f09b6eb9b8febe807a017e935a9e4c11182c95 | |
parent | 79e9e78f9e9b0747d8e9c19cf4dd87df78773bcf (diff) |
handle MSO 2007 vs OOXML in auto title chart import
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 | 4 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 3 |
4 files changed, 11 insertions, 5 deletions
diff --git a/include/oox/drawingml/chart/chartspacemodel.hxx b/include/oox/drawingml/chart/chartspacemodel.hxx index f1a27d80e706..c2e3cabfd509 100644 --- a/include/oox/drawingml/chart/chartspacemodel.hxx +++ b/include/oox/drawingml/chart/chartspacemodel.hxx @@ -57,7 +57,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 9917588275b3..8df7f3b0e45d 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -81,8 +81,13 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const switch( nElement ) { case C_TOKEN( autoTitleDeleted ): - mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, true ); // TODO: OOXML_spec + { + 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 d36a2f282b57..da86a4bc663e 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -25,10 +25,10 @@ namespace chart { // ============================================================================ -ChartSpaceModel::ChartSpaceModel() : +ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : mnDispBlanksAs( XML_gap ), // not zero as specified, TODO: OOXML_spec mnStyle( 2 ), - mbAutoTitleDel( false ), + 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 871043521c0c..e3f324efe334 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -869,7 +869,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-> |