From 709f06eb261b3225cd4b56a7efb8e2d591909960 Mon Sep 17 00:00:00 2001 From: Muthu Subramanian Date: Wed, 26 Mar 2014 10:43:08 +0000 Subject: n#862510: anchorCtr controls the anchoring as well. (cherry picked from commit c17eb67460293fbe72ffa8e80cd10743df493afa) Signed-off-by: Andras Timar Conflicts: oox/source/drawingml/textbodypropertiescontext.cxx Change-Id: Ib244d89a9f7d400b3891d477314cd5f0193552e0 --- diff --git a/include/oox/drawingml/textbodyproperties.hxx b/include/oox/drawingml/textbodyproperties.hxx index 3fb0684..af68f20 100644 --- a/include/oox/drawingml/textbodyproperties.hxx +++ b/include/oox/drawingml/textbodyproperties.hxx @@ -34,6 +34,7 @@ struct TextBodyProperties { PropertyMap maPropertyMap; OptValue< sal_Int32 > moRotation; + bool mbAnchorCtr; OptValue< sal_Int32 > moVert; boost::optional< sal_Int32 > moInsets[4]; boost::optional< sal_Int32 > moTextOffX; diff --git a/oox/source/drawingml/textbodyproperties.cxx b/oox/source/drawingml/textbodyproperties.cxx index 36f39d9..9e53897 100644 --- a/oox/source/drawingml/textbodyproperties.cxx +++ b/oox/source/drawingml/textbodyproperties.cxx @@ -80,8 +80,8 @@ void TextBodyProperties::pushRotationAdjustments( sal_Int32 nRotation ) // Hack for n#760986 // TODO: Preferred method would be to have a textbox on top // of the shape and the place it according to the (off,ext) - if( nOff == 0 && moTextOffX ) nVal = *moTextOffX; - if( nOff == 1 && moTextOffY ) nVal = *moTextOffY; + if( nOff == 0 && moTextOffX && mbAnchorCtr ) nVal = *moTextOffX; + if( nOff == 1 && moTextOffY && mbAnchorCtr ) nVal = *moTextOffY; if( nVal < 0 ) nVal = 0; if( moInsets[i] ) diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx index 358db9f..b580be3 100644 --- a/oox/source/drawingml/textbodypropertiescontext.cxx +++ b/oox/source/drawingml/textbodypropertiescontext.cxx @@ -56,9 +56,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler2Helper& rPa mrTextBodyProp.moInsets[i] = GetCoordinate( sValue ); } - bool bAnchorCenter = rAttribs.getBool( XML_anchorCtr, false ); + mrTextBodyProp.mbAnchorCtr = rAttribs.getBool( XML_anchorCtr, false ); if( rAttribs.hasAttribute( XML_anchorCtr ) ) { - if( bAnchorCenter ) + if( mrTextBodyProp.mbAnchorCtr ) mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<= TextHorizontalAdjust_CENTER; } -- cgit v0.9.0.2-2-gbebe