From 25ede145f926b2f3212a74e66fe2b2cf8fde9445 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Mon, 20 Apr 2015 04:35:34 +0200 Subject: fix legend pos overlay MSO 2007 vs OOXML Change-Id: I277bdd76e79310992bbf645d9e215f4dbba47554 --- oox/inc/drawingml/chart/titlemodel.hxx | 2 +- oox/source/drawingml/chart/chartspacefragment.cxx | 5 ++--- oox/source/drawingml/chart/titlecontext.cxx | 3 ++- oox/source/drawingml/chart/titlemodel.cxx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'oox') diff --git a/oox/inc/drawingml/chart/titlemodel.hxx b/oox/inc/drawingml/chart/titlemodel.hxx index 3d140c93f755..a78c4ff0479f 100644 --- a/oox/inc/drawingml/chart/titlemodel.hxx +++ b/oox/inc/drawingml/chart/titlemodel.hxx @@ -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(); }; diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 159bc0e50243..2c02642eb6c2 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -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 ): diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx index 0f87cbfc9fb9..b8accabca6ff 100644 --- a/oox/source/drawingml/chart/titlecontext.cxx +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -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 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 ): diff --git a/oox/source/drawingml/chart/titlemodel.cxx b/oox/source/drawingml/chart/titlemodel.cxx index 3ca7f5d58cd9..1f7153304db2 100644 --- a/oox/source/drawingml/chart/titlemodel.cxx +++ b/oox/source/drawingml/chart/titlemodel.cxx @@ -41,9 +41,9 @@ TitleModel::~TitleModel() { } -LegendModel::LegendModel() : +LegendModel::LegendModel(bool bMSO2007Doc) : mnPosition( XML_r ), - mbOverlay( false ) + mbOverlay( !bMSO2007Doc ) { } -- cgit