summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-03-31 15:04:31 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-03-31 15:04:31 +0530
commit193ecefaef948272695b0dd0a42a3bcc3256f631 (patch)
treebf37766155ebb438a30f134c975c87a9b3c560a8
parent36611abf83c6ccfab9f5e18dd90a6664f514b7ba (diff)
n#862510: anchorCtr controls the anchoring as well.
Ported from: c17eb67460293fbe72ffa8e80cd10743df493afa Change-Id: I7b5885c3ac9ec30970bdb8b2c9318dc181dda5bd
-rw-r--r--oox/inc/oox/drawingml/textbodyproperties.hxx1
-rw-r--r--oox/source/drawingml/textbodyproperties.cxx4
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx4
3 files changed, 5 insertions, 4 deletions
diff --git a/oox/inc/oox/drawingml/textbodyproperties.hxx b/oox/inc/oox/drawingml/textbodyproperties.hxx
index f8800be29659..c026b4e1d108 100644
--- a/oox/inc/oox/drawingml/textbodyproperties.hxx
+++ b/oox/inc/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 36f39d93953f..9e538973201e 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 273c5cf63719..f8e0594bccf0 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -61,9 +61,9 @@ TextBodyPropertiesContext::TextBodyPropertiesContext( ContextHandler& rParent,
mrTextBodyProp.moInsets[i] = GetCoordinate( sValue );
}
- bool bAnchorCenter = aAttribs.getBool( XML_anchorCtr, false );
+ mrTextBodyProp.mbAnchorCtr = aAttribs.getBool( XML_anchorCtr, false );
if( xAttributes->hasAttribute( XML_anchorCtr ) ) {
- if( bAnchorCenter )
+ if( mrTextBodyProp.mbAnchorCtr )
mrTextBodyProp.maPropertyMap[ PROP_TextHorizontalAdjust ] <<=
TextHorizontalAdjust_CENTER;
}