oox/source/drawingml/shape.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
New commits: commit 74977861a63c920f9b49e90087cac9a841392729 Author: Paul Trojahn <paul.troj...@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 <c...@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zol...@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() ); }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits