fix AxisModel MSO2007 vs OOXMl default values
Change-Id: Ie4265bf5ef02126d88d7521f86b0b922f77817a8
This commit is contained in:
@@ -87,7 +87,7 @@ struct AxisModel
|
||||
bool mbDeleted; /// True = axis has been deleted manually.
|
||||
bool mbNoMultiLevel; /// True = no multi-level categories supported.
|
||||
|
||||
explicit AxisModel( sal_Int32 nTypeId );
|
||||
explicit AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc );
|
||||
~AxisModel();
|
||||
};
|
||||
|
||||
|
@@ -86,6 +86,7 @@ AxisContextBase::~AxisContextBase()
|
||||
|
||||
ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
|
||||
{
|
||||
bool bMSO2007Doc = getFilter().isMSO2007Document();
|
||||
switch( getCurrentElement() )
|
||||
{
|
||||
case C_TOKEN( catAx ):
|
||||
@@ -107,8 +108,7 @@ ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const At
|
||||
mrModel.mofCrossesAt = rAttribs.getDouble( XML_val, 0.0 );
|
||||
return 0;
|
||||
case C_TOKEN( delete ):
|
||||
// default is 'false', not 'true' as specified
|
||||
mrModel.mbDeleted = rAttribs.getBool( XML_val, false );
|
||||
mrModel.mbDeleted = rAttribs.getBool( XML_val, !bMSO2007Doc );
|
||||
return 0;
|
||||
case C_TOKEN( majorGridlines ):
|
||||
return new ShapePrWrapperContext( *this, mrModel.mxMajorGridLines.create() );
|
||||
|
@@ -32,7 +32,7 @@ AxisDispUnitsModel::~AxisDispUnitsModel()
|
||||
{
|
||||
}
|
||||
|
||||
AxisModel::AxisModel( sal_Int32 nTypeId ) :
|
||||
AxisModel::AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc ) :
|
||||
mnAxisId( -1 ),
|
||||
mnAxisPos( XML_TOKEN_INVALID ),
|
||||
mnCrossAxisId( -1 ),
|
||||
@@ -50,7 +50,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId ) :
|
||||
mnTickMarkSkip( 0 ),
|
||||
mnTypeId( nTypeId ),
|
||||
mbAuto( false ),
|
||||
mbDeleted( false ),
|
||||
mbDeleted( !bMSO2007Doc ),
|
||||
mbNoMultiLevel( false )
|
||||
{
|
||||
}
|
||||
|
@@ -179,13 +179,13 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
|
||||
return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement, bMSO2007Doc ) );
|
||||
|
||||
case C_TOKEN( catAx ):
|
||||
return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
|
||||
return new CatAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
|
||||
case C_TOKEN( dateAx ):
|
||||
return new DateAxisContext( *this, mrModel.maAxes.create( nElement ) );
|
||||
return new DateAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
|
||||
case C_TOKEN( serAx ):
|
||||
return new SerAxisContext( *this, mrModel.maAxes.create( nElement ) );
|
||||
return new SerAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
|
||||
case C_TOKEN( valAx ):
|
||||
return new ValAxisContext( *this, mrModel.maAxes.create( nElement ) );
|
||||
return new ValAxisContext( *this, mrModel.maAxes.create( nElement, bMSO2007Doc ) );
|
||||
|
||||
case C_TOKEN( layout ):
|
||||
return new LayoutContext( *this, mrModel.mxLayout.create() );
|
||||
|
@@ -99,11 +99,11 @@ AxesSetConverter::~AxesSetConverter()
|
||||
{
|
||||
}
|
||||
|
||||
ModelRef< AxisModel > lclGetOrCreateAxis( const AxesSetModel::AxisMap& rFromAxes, sal_Int32 nAxisIdx, sal_Int32 nDefTypeId )
|
||||
ModelRef< AxisModel > lclGetOrCreateAxis( const AxesSetModel::AxisMap& rFromAxes, sal_Int32 nAxisIdx, sal_Int32 nDefTypeId, bool bMSO2007Doc )
|
||||
{
|
||||
ModelRef< AxisModel > xAxis = rFromAxes.get( nAxisIdx );
|
||||
if( !xAxis )
|
||||
xAxis.create( nDefTypeId ).mbDeleted = true; // missing axis is invisible
|
||||
xAxis.create( nDefTypeId, bMSO2007Doc ).mbDeleted = true; // missing axis is invisible
|
||||
return xAxis;
|
||||
}
|
||||
|
||||
@@ -159,9 +159,10 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
|
||||
to the data provider attached to the chart document. */
|
||||
if( xCoordSystem.is() )
|
||||
{
|
||||
bool bMSO2007Doc = getFilter().isMSO2007Document();
|
||||
// convert all axes (create missing axis models)
|
||||
ModelRef< AxisModel > xXAxis = lclGetOrCreateAxis( mrModel.maAxes, API_X_AXIS, rFirstTypeGroup.getTypeInfo().mbCategoryAxis ? C_TOKEN( catAx ) : C_TOKEN( valAx ) );
|
||||
ModelRef< AxisModel > xYAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Y_AXIS, C_TOKEN( valAx ) );
|
||||
ModelRef< AxisModel > xXAxis = lclGetOrCreateAxis( mrModel.maAxes, API_X_AXIS, rFirstTypeGroup.getTypeInfo().mbCategoryAxis ? C_TOKEN( catAx ) : C_TOKEN( valAx ), bMSO2007Doc );
|
||||
ModelRef< AxisModel > xYAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Y_AXIS, C_TOKEN( valAx ), bMSO2007Doc );
|
||||
|
||||
AxisConverter aXAxisConv( *this, *xXAxis );
|
||||
aXAxisConv.convertFromModel( xCoordSystem, aTypeGroups, xYAxis.get(), nAxesSetIdx, API_X_AXIS );
|
||||
@@ -170,7 +171,7 @@ void AxesSetConverter::convertFromModel( const Reference< XDiagram >& rxDiagram,
|
||||
|
||||
if( rFirstTypeGroup.isDeep3dChart() )
|
||||
{
|
||||
ModelRef< AxisModel > xZAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Z_AXIS, C_TOKEN( serAx ) );
|
||||
ModelRef< AxisModel > xZAxis = lclGetOrCreateAxis( mrModel.maAxes, API_Z_AXIS, C_TOKEN( serAx ), bMSO2007Doc );
|
||||
AxisConverter aZAxisConv( *this, *xZAxis );
|
||||
aZAxisConv.convertFromModel( xCoordSystem, aTypeGroups, 0, nAxesSetIdx, API_Z_AXIS );
|
||||
}
|
||||
|
Reference in New Issue
Block a user