summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-10 00:59:28 +0100
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2015-03-10 01:00:03 +0100
commit23a1717881ebfa3638b969aa4bad38a81d26d29d (patch)
treea96e63e5c9cf0c10b5e1e0a0466c9b9f8730117b
parent15174177091367332b57cd79575e2f7dd27388b2 (diff)
handle MSO 2007 vs OOXML in auto title chart import
Change-Id: Id884a4c90c24b38a1dd22a41d271dcc551b59adc
-rw-r--r--oox/inc/drawingml/chart/chartspacemodel.hxx2
-rw-r--r--oox/source/drawingml/chart/chartspacefragment.cxx7
-rw-r--r--oox/source/drawingml/chart/chartspacemodel.cxx4
-rw-r--r--oox/source/drawingml/shape.cxx3
4 files changed, 11 insertions, 5 deletions
diff --git a/oox/inc/drawingml/chart/chartspacemodel.hxx b/oox/inc/drawingml/chart/chartspacemodel.hxx
index e8ddb9c41c93..4a98bbf487fc 100644
--- a/oox/inc/drawingml/chart/chartspacemodel.hxx
+++ b/oox/inc/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 ac12bf53c555..eb014ef9002c 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 ea14c3c38438..7dab05808754 100644
--- a/oox/source/drawingml/chart/chartspacemodel.cxx
+++ b/oox/source/drawingml/chart/chartspacemodel.cxx
@@ -24,10 +24,10 @@ namespace oox {
namespace drawingml {
namespace chart {
-ChartSpaceModel::ChartSpaceModel() :
+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 59350e2df90a..bea5cd2f4ed4 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1271,7 +1271,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->