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

Caolán McNamara caolanm at redhat.com
Thu Nov 27 04:31:01 PST 2014


 xmloff/source/draw/ximpshap.cxx |   32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

New commits:
commit ecf0d01e091ab0dde5845fe9b0a47ba1a961eda2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 27 11:30:45 2014 +0000

    Resolves: fdo#84043 don't create duplicate Mirrored[X|Y] properties
    
    regression from 13ef16423e78d3ea825172594f08c47d2f9bfd09
    
    commit 13ef16423e78d3ea825172594f08c47d2f9bfd09
    Author: Armin Le Grand <alg at apache.org>
    Date:   Wed Nov 21 13:23:01 2012 +0000
    
        For backward compatibility take mirrorings in setTransformation into account
    
        Also found an error in SdrObjCustomShape::TRGetBaseGeometry when MirrorY was used
    
        (cherry picked from commit 4116c33b12d3787c406f0348f89efcb1cf409507)
    
    Change-Id: I7bfb5dea32b8ab8498e3d92975c49b830c81e6fb
    (cherry picked from commit 751e5b32c5c361995bf0ba3295f773341fd92c23)
    Reviewed-on: https://gerrit.libreoffice.org/13149
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit d3b7bf16a58c02af2d1fdf5db2fa149c6815095c)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 65c3084..d4ec1b8 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3694,22 +3694,38 @@ void SdXMLCustomShapeContext::EndElement()
 
         if(bFlippedX || bFlippedY)
         {
-            beans::PropertyValue aNewPoroperty;
+            OUString sName;
 
             if(bFlippedX)
+                sName = "MirroredX";
+            else
+                sName = "MirroredY";
+
+            //fdo#84043 overwrite the property if it already exists, otherwise append it
+            beans::PropertyValue* pItem;
+            std::vector< beans::PropertyValue >::iterator aI(maCustomShapeGeometry.begin());
+            std::vector< beans::PropertyValue >::iterator aE(maCustomShapeGeometry.end());
+            while (aI != aE)
+            {
+                if (aI->Name == sName)
+                    break;
+                ++aI;
+            }
+            if (aI != aE)
             {
-                aNewPoroperty.Name = "MirroredX";
+                beans::PropertyValue& rItem = *aI;
+                pItem = &rItem;
             }
             else
             {
-                aNewPoroperty.Name = "MirroredY";
+                maCustomShapeGeometry.push_back(beans::PropertyValue());
+                pItem = &maCustomShapeGeometry.back();
             }
 
-            aNewPoroperty.Handle = -1;
-            aNewPoroperty.Value <<= sal_True;
-            aNewPoroperty.State = beans::PropertyState_DIRECT_VALUE;
-
-            maCustomShapeGeometry.push_back(aNewPoroperty);
+            pItem->Name = sName;
+            pItem->Handle = -1;
+            pItem->Value <<= sal_True;
+            pItem->State = beans::PropertyState_DIRECT_VALUE;
         }
     }
 


More information about the Libreoffice-commits mailing list