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:
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; }
......
......@@ -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();
};
......
......@@ -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 ) );
......
......@@ -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;
......
......@@ -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 )
{
}
......
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