Kaydet (Commit) 25ede145 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

fix legend pos overlay MSO 2007 vs OOXML

Change-Id: I277bdd76e79310992bbf645d9e215f4dbba47554
üst f3ec35db
......@@ -74,7 +74,7 @@ struct LegendModel
sal_Int32 mnPosition; /// Legend position.
bool mbOverlay; /// True = legend may overlay other objects.
explicit LegendModel();
explicit LegendModel(bool bMSO2007Doc);
~LegendModel();
};
......
......@@ -43,6 +43,7 @@ ChartSpaceFragment::~ChartSpaceFragment()
ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
bool bMSO2007Document = getFilter().isMSO2007Document();
switch( getCurrentElement() )
{
case XML_ROOT_CONTEXT:
......@@ -82,7 +83,6 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
{
case C_TOKEN( autoTitleDeleted ):
{
bool bMSO2007Document = getFilter().isMSO2007Document();
// default value is false for MSO 2007 and true in OOXML
mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, !bMSO2007Document );
......@@ -92,7 +92,6 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
return new WallFloorContext( *this, mrModel.mxBackWall.create() );
case C_TOKEN( dispBlanksAs ):
{
bool bMSO2007Document = getFilter().isMSO2007Document();
// default value is XML_gap for MSO 2007 and XML_zero in OOXML
mrModel.mnDispBlanksAs = rAttribs.getToken( XML_val, bMSO2007Document ? XML_gap : XML_zero );
return 0;
......@@ -100,7 +99,7 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const
case C_TOKEN( floor ):
return new WallFloorContext( *this, mrModel.mxFloor.create() );
case C_TOKEN( legend ):
return new LegendContext( *this, mrModel.mxLegend.create() );
return new LegendContext( *this, mrModel.mxLegend.create(bMSO2007Document) );
case C_TOKEN( plotArea ):
return new PlotAreaContext( *this, mrModel.mxPlotArea.create() );
case C_TOKEN( plotVisOnly ):
......
......@@ -122,6 +122,7 @@ LegendContext::~LegendContext()
ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
bool bMSO2007Doc = getFilter().isMSO2007Document();
// this context handler is used for <c:legend> only
switch( nElement )
{
......@@ -134,7 +135,7 @@ ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const Attr
case C_TOKEN( overlay ):
// default is 'false', not 'true' as specified
mrModel.mbOverlay = rAttribs.getBool( XML_val, false );
mrModel.mbOverlay = rAttribs.getBool( XML_val, !bMSO2007Doc );
return 0;
case C_TOKEN( spPr ):
......
......@@ -41,9 +41,9 @@ TitleModel::~TitleModel()
{
}
LegendModel::LegendModel() :
LegendModel::LegendModel(bool bMSO2007Doc) :
mnPosition( XML_r ),
mbOverlay( false )
mbOverlay( !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