Kaydet (Commit) 1478d2c3 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

fix TypeGroup MSO 2007 vs OOXML default values

Change-Id: I0d01e5b8d5f284ee3049debaf9fba0012dae005d
üst 0791b8f1
...@@ -43,6 +43,8 @@ public: ...@@ -43,6 +43,8 @@ public:
ModelType& create() { this->reset( new ModelType ); return **this; } ModelType& create() { this->reset( new ModelType ); return **this; }
template< typename Param1Type > template< typename Param1Type >
ModelType& create( const Param1Type& rParam1 ) { this->reset( new ModelType( rParam1 ) ); return **this; } 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; } ModelType& getOrCreate() { if( !*this ) this->reset( new ModelType ); return **this; }
template< typename Param1Type > template< typename Param1Type >
...@@ -62,6 +64,8 @@ public: ...@@ -62,6 +64,8 @@ public:
ModelType& create() { return append( new ModelType ); } ModelType& create() { return append( new ModelType ); }
template< typename Param1Type > template< typename Param1Type >
ModelType& create( const Param1Type& rParam1 ) { return append( new ModelType( rParam1 ) ); } 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: private:
ModelType& append( ModelType* pModel ) { this->push_back( value_type( pModel ) ); return *pModel; } ModelType& append( ModelType* pModel ) { this->push_back( value_type( pModel ) ); return *pModel; }
......
...@@ -77,7 +77,7 @@ struct TypeGroupModel ...@@ -77,7 +77,7 @@ struct TypeGroupModel
bool mbVaryColors; /// True = different automatic colors for each point. bool mbVaryColors; /// True = different automatic colors for each point.
bool mbWireframe; /// True = wireframe surface chart, false = filled surface chart. bool mbWireframe; /// True = wireframe surface chart, false = filled surface chart.
explicit TypeGroupModel( sal_Int32 nTypeId ); explicit TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc );
~TypeGroupModel(); ~TypeGroupModel();
}; };
......
...@@ -146,6 +146,7 @@ PlotAreaContext::~PlotAreaContext() ...@@ -146,6 +146,7 @@ PlotAreaContext::~PlotAreaContext()
ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& ) ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{ {
bool bMSO2007Doc = getFilter().isMSO2007Document();
switch( getCurrentElement() ) switch( getCurrentElement() )
{ {
case C_TOKEN( plotArea ): case C_TOKEN( plotArea ):
...@@ -153,28 +154,28 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At ...@@ -153,28 +154,28 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
{ {
case C_TOKEN( area3DChart ): case C_TOKEN( area3DChart ):
case C_TOKEN( areaChart ): 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( bar3DChart ):
case C_TOKEN( barChart ): 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 ): 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( line3DChart ):
case C_TOKEN( lineChart ): case C_TOKEN( lineChart ):
case C_TOKEN( stockChart ): 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( doughnutChart ):
case C_TOKEN( ofPieChart ): case C_TOKEN( ofPieChart ):
case C_TOKEN( pie3DChart ): case C_TOKEN( pie3DChart ):
case C_TOKEN( pieChart ): 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 ): 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 ): 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( surface3DChart ):
case C_TOKEN( surfaceChart ): 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 ): case C_TOKEN( catAx ):
return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) ); return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
......
...@@ -227,7 +227,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con ...@@ -227,7 +227,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con
case C_TOKEN( upDownBars ): case C_TOKEN( upDownBars ):
return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() ); return new UpDownBarsContext( *this, mrModel.mxUpDownBars.create() );
case C_TOKEN( varyColors ): case C_TOKEN( varyColors ):
mrModel.mbVaryColors = rAttribs.getBool( XML_val, bMSO2007Doc ); mrModel.mbVaryColors = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0; return 0;
} }
return 0; return 0;
......
...@@ -33,7 +33,7 @@ UpDownBarsModel::~UpDownBarsModel() ...@@ -33,7 +33,7 @@ UpDownBarsModel::~UpDownBarsModel()
{ {
} }
TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) : TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) :
mfSplitPos( 0.0 ), mfSplitPos( 0.0 ),
mnBarDir( XML_col ), mnBarDir( XML_col ),
mnBubbleScale( 100 ), mnBubbleScale( 100 ),
...@@ -51,12 +51,12 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) : ...@@ -51,12 +51,12 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
mnSizeRepresents( XML_area ), mnSizeRepresents( XML_area ),
mnSplitType( XML_auto ), mnSplitType( XML_auto ),
mnTypeId( nTypeId ), mnTypeId( nTypeId ),
mbBubble3d( false ), mbBubble3d( !bMSO2007Doc ),
mbShowMarker( false ), mbShowMarker( !bMSO2007Doc ),
mbShowNegBubbles( false ), mbShowNegBubbles( !bMSO2007Doc ),
mbSmooth( false ), mbSmooth( !bMSO2007Doc ),
mbVaryColors( false ), mbVaryColors( !bMSO2007Doc ),
mbWireframe( false ) mbWireframe( !bMSO2007Doc )
{ {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment