summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-21 03:25:03 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-21 06:44:32 +0200
commit1478d2c37e57db1ee869f8ca5573b7dc7c7d6a51 (patch)
tree354afca25402041c1477dc1c89941f135a85d67a
parent0791b8f1d35f2795ff87e21d04395b3ec8bd831d (diff)
fix TypeGroup MSO 2007 vs OOXML default values
Change-Id: I0d01e5b8d5f284ee3049debaf9fba0012dae005d
-rw-r--r--include/oox/drawingml/chart/modelbase.hxx4
-rw-r--r--oox/inc/drawingml/chart/typegroupmodel.hxx2
-rw-r--r--oox/source/drawingml/chart/plotareacontext.cxx17
-rw-r--r--oox/source/drawingml/chart/typegroupcontext.cxx2
-rw-r--r--oox/source/drawingml/chart/typegroupmodel.cxx14
5 files changed, 22 insertions, 17 deletions
diff --git a/include/oox/drawingml/chart/modelbase.hxx b/include/oox/drawingml/chart/modelbase.hxx
index 6819e512449a..0d01fc4d19b1 100644
--- a/include/oox/drawingml/chart/modelbase.hxx
+++ b/include/oox/drawingml/chart/modelbase.hxx
@@ -43,6 +43,8 @@ public:
ModelType& create() { this->reset( new ModelType ); return **this; }
template< typename Param1Type >
ModelType& create( const Param1Type& rParam1 ) { this->reset( new ModelType( rParam1 ) ); return **this; }
+ template< typename Param1Type, typename Param2Type >
+ ModelType& create( const Param1Type& rParam1, const Param2Type& rParam2 ) { this->reset( new ModelType( rParam1, rParam2 ) ); return **this; }
ModelType& getOrCreate() { if( !*this ) this->reset( new ModelType ); return **this; }
template< typename Param1Type >
@@ -62,6 +64,8 @@ public:
ModelType& create() { return append( new ModelType ); }
template< typename Param1Type >
ModelType& create( const Param1Type& rParam1 ) { return append( new ModelType( rParam1 ) ); }
+ template< typename Param1Type, typename Param2Type >
+ ModelType& create( const Param1Type& rParam1, const Param2Type& rParam2 ) { return append( new ModelType( rParam1, rParam2 ) ); }
private:
ModelType& append( ModelType* pModel ) { this->push_back( value_type( pModel ) ); return *pModel; }
diff --git a/oox/inc/drawingml/chart/typegroupmodel.hxx b/oox/inc/drawingml/chart/typegroupmodel.hxx
index 72d5586c3395..ea40faa83a1c 100644
--- a/oox/inc/drawingml/chart/typegroupmodel.hxx
+++ b/oox/inc/drawingml/chart/typegroupmodel.hxx
@@ -77,7 +77,7 @@ struct TypeGroupModel
bool mbVaryColors; /// True = different automatic colors for each point.
bool mbWireframe; /// True = wireframe surface chart, false = filled surface chart.
- explicit TypeGroupModel( sal_Int32 nTypeId );
+ explicit TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc );
~TypeGroupModel();
};
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index 53cb1ae9c9ee..acbe4f12d0e3 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -146,6 +146,7 @@ PlotAreaContext::~PlotAreaContext()
ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
+ bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case C_TOKEN( plotArea ):
@@ -153,28 +154,28 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
{
case C_TOKEN( area3DChart ):
case C_TOKEN( areaChart ):
- return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( bar3DChart ):
case C_TOKEN( barChart ):
- return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( bubbleChart ):
- return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( line3DChart ):
case C_TOKEN( lineChart ):
case C_TOKEN( stockChart ):
- return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( doughnutChart ):
case C_TOKEN( ofPieChart ):
case C_TOKEN( pie3DChart ):
case C_TOKEN( pieChart ):
- return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( radarChart ):
- return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( scatterChart ):
- return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( surface3DChart ):
case C_TOKEN( surfaceChart ):
- return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
+ return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
case C_TOKEN( catAx ):
return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index ae3f4477770b..63546f953f0b 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -227,7 +227,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( upDownBars ):
return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() );
case C_TOKEN( varyColors ):
- mrModel.mbVaryColors = rAttribs.getBool( XML_val, bMSO2007Doc );
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
}
return 0;
diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx
index f27f6dac9341..e8b3d11f5218 100644
--- a/oox/source/drawingml/chart/typegroupmodel.cxx
+++ b/oox/source/drawingml/chart/typegroupmodel.cxx
@@ -33,7 +33,7 @@ UpDownBarsModel::~UpDownBarsModel()
{
}
-TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
+TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) :
mfSplitPos( 0.0 ),
mnBarDir( XML_col ),
mnBubbleScale( 100 ),
@@ -51,12 +51,12 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
mnSizeRepresents( XML_area ),
mnSplitType( XML_auto ),
mnTypeId( nTypeId ),
- mbBubble3d( false ),
- mbShowMarker( false ),
- mbShowNegBubbles( false ),
- mbSmooth( false ),
- mbVaryColors( false ),
- mbWireframe( false )
+ mbBubble3d( !bMSO2007Doc ),
+ mbShowMarker( !bMSO2007Doc ),
+ mbShowNegBubbles( !bMSO2007Doc ),
+ mbSmooth( !bMSO2007Doc ),
+ mbVaryColors( !bMSO2007Doc ),
+ mbWireframe( !bMSO2007Doc )
{
}