summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorPaul Trojahn <paul.trojahn@gmail.com>2017-09-24 21:30:06 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-10-05 12:50:45 +0200
commit74977861a63c920f9b49e90087cac9a841392729 (patch)
tree741713010f94e83918d8990ddcd8b857c18a46ce /oox
parent4aa3a0b20f6140c716ac933fc575b202209881f9 (diff)
tdf#100065 Refactoring
Change-Id: I842f90b655ccf195185bf8bae2d93b5b187954aa Reviewed-on: https://gerrit.libreoffice.org/43137 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx10
1 files changed, 4 insertions, 6 deletions
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() );
}