summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/fillproperties.cxx
diff options
context:
space:
mode:
authorPaul Trojahn <paul.trojahn@gmail.com>2017-07-23 22:59:25 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-08-10 17:50:47 +0200
commit5fc980154a968d8f48803289f0042d105dfc102a (patch)
treec48b9afe0767d7ff548a1fc0759bf7c4e6d449ae /oox/source/drawingml/fillproperties.cxx
parentc3f8727fe88e3073272f573516d5662ddcbbaa13 (diff)
tdf#109187 Fix OOXML import of flipped shapes with gradients
The rotation of the gradient instead of the shape needs to be flipped because OOXML flips shapes before rotating them. Change-Id: I332412078ae0f8d555bd462964c7b20037147e02 Reviewed-on: https://gerrit.libreoffice.org/40136 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox/source/drawingml/fillproperties.cxx')
-rw-r--r--oox/source/drawingml/fillproperties.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 81ab8c66396a..925db22fb5f9 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -356,12 +356,6 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
nStartTrans = maGradientProps.maGradientStops.begin()->second.getTransparency()*255/100;
}
- // Adjust for flips
- if ( bFlipH )
- nShapeRotation = 180*60000 - nShapeRotation;
- if ( bFlipV )
- nShapeRotation = -nShapeRotation;
-
// "rotate with shape" set to false -> do not rotate
if ( !maGradientProps.moRotateWithShape.get( true ) )
nShapeRotation = 0;
@@ -533,7 +527,13 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
// Now we have a potential border and a largest segment. Use those.
aGradient.Style = bSymmetric ? awt::GradientStyle_AXIAL : awt::GradientStyle_LINEAR;
- sal_Int32 nDmlAngle = maGradientProps.moShadeAngle.get( 0 ) + nShapeRotation;
+ sal_Int32 nShadeAngle = maGradientProps.moShadeAngle.get( 0 );
+ // Adjust for flips
+ if ( bFlipH )
+ nShadeAngle = 180*60000 - nShadeAngle;
+ if ( bFlipV )
+ nShadeAngle = -nShadeAngle;
+ sal_Int32 nDmlAngle = nShadeAngle + nShapeRotation;
// convert DrawingML angle (in 1/60000 degrees) to API angle (in 1/10 degrees)
aGradient.Angle = static_cast< sal_Int16 >( (8100 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 );
Color aStartColor, aEndColor;