[Libreoffice-commits] core.git: oox/source

Paul Trojahn paul.trojahn at gmail.com
Thu Oct 5 10:51:15 UTC 2017


 oox/source/drawingml/shape.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 74977861a63c920f9b49e90087cac9a841392729
Author: Paul Trojahn <paul.trojahn at gmail.com>
Date:   Sun Sep 24 21:30:06 2017 +0200

    tdf#100065 Refactoring
    
    Change-Id: I842f90b655ccf195185bf8bae2d93b5b187954aa
    Reviewed-on: https://gerrit.libreoffice.org/43137
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 6064220e602c..f0d03f61e6fa 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -507,7 +507,6 @@ Reference< XShape > const & Shape::createAndInsert(
         if( bUseRotationTransform )
         {
             // OOXML flips shapes before rotating them.
-            double fRotation = F_PI180 * ( (double)mnRotation / 60000.0 );
             if( bIsCustomShape )
             {
                 basegfx::B2DVector aScale, aTranslate;
@@ -526,7 +525,7 @@ Reference< XShape > const & Shape::createAndInsert(
                 }
             }
             // rotate around object's center
-            aTransformation.rotate( fRotation );
+            aTransformation.rotate( F_PI180 * ( (double)mnRotation / 60000.0 ) );
         }
 
         // move object back from center
@@ -546,20 +545,19 @@ Reference< XShape > const & Shape::createAndInsert(
     aParentTransformation = aTransformation;
     aTransformation.scale(1/double(EMU_PER_HMM), 1/double(EMU_PER_HMM));
 
-    if( bIsCustomShape )
+    if( bIsCustomShape && mbFlipH != mbFlipV )
     {
         basegfx::B2DVector aScale, aTranslate;
         double fRotate, fShearX;
         aTransformation.decompose(aScale, aTranslate, fRotate, fShearX);
 
-        // OOXML rotates shapes before flipping them, so the rotation needs to be inverted.
-        if( mbFlipH != mbFlipV)
+        if(fRotate != 0)
         {
             // calculate object's center
             basegfx::B2DPoint aCenter(0.5, 0.5);
             aCenter *= aTransformation;
-
             aTransformation.translate( -aCenter.getX(), -aCenter.getY() );
+            // OOXML flips shapes before rotating them, so the rotation needs to be inverted
             aTransformation.rotate( fRotate * -2.0 );
             aTransformation.translate( aCenter.getX(), aCenter.getY() );
         }


More information about the Libreoffice-commits mailing list