[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - include/oox oox/source

Muthu Subramanian sumuthu at collabora.com
Sun May 11 08:40:52 PDT 2014


 include/oox/drawingml/textbodyproperties.hxx       |    1 +
 oox/source/drawingml/textbodyproperties.cxx        |    4 ++--
 oox/source/drawingml/textbodypropertiescontext.cxx |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 709f06eb261b3225cd4b56a7efb8e2d591909960
Author: Muthu Subramanian <sumuthu at collabora.com>
Date:   Wed Mar 26 16:13:08 2014 +0530

    n#862510: anchorCtr controls the anchoring as well.
    
    (cherry picked from commit c17eb67460293fbe72ffa8e80cd10743df493afa)
    Signed-off-by: Andras Timar <andras.timar at collabora.com>
    
    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;
     }


More information about the Libreoffice-commits mailing list