Kaydet (Commit) c17eb674 authored tarafından Muthu Subramanian's avatar Muthu Subramanian

n#862510: anchorCtr controls the anchoring as well.

Change-Id: Ib244d89a9f7d400b3891d477314cd5f0193552e0
üst e3e12b1d
......@@ -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;
......
......@@ -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] )
......
......@@ -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.setProperty( PROP_TextHorizontalAdjust,
TextHorizontalAdjust_CENTER);
}
......
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