summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-03-31 15:04:31 +0530
committerAndras Timar <andras.timar@collabora.com>2014-04-03 05:31:30 -0700
commite496a24b444946c0309d3d1144970417e7b0a876 (patch)
treeb076eb18281e472b736bcdf286c2ca95883b6a62
parentd3ce557d214ec8452c905a602ed85adb54e5f4e5 (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;
}