From 41f098c0a2363f7607516a9fe20706ad4201b45c Mon Sep 17 00:00:00 2001 From: Paul Trojahn Date: Tue, 4 Jul 2017 19:38:31 +0200 Subject: [PATCH] tdf#89926 Fix OOXML gradient angle import The rotation of the shape needs to be added to get the correct angle. Due to this nDmlAngle can be twice as big. The conversion to LO angles needs to be updated to prevent negative results. Change-Id: I3a13cb268af41a55cd8b9df3084d028008aed4f2 Reviewed-on: https://gerrit.libreoffice.org/39648 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- oox/source/drawingml/fillproperties.cxx | 4 ++-- sd/qa/unit/data/xml/n762695_0.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 314ff5822695..7d986709603b 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -533,9 +533,9 @@ 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 nDmlAngle = maGradientProps.moShadeAngle.get( 0 ) + nShapeRotation; // convert DrawingML angle (in 1/60000 degrees) to API angle (in 1/10 degrees) - aGradient.Angle = static_cast< sal_Int16 >( (4500 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 ); + aGradient.Angle = static_cast< sal_Int16 >( (8100 - (nDmlAngle / (PER_DEGREE / 10))) % 3600 ); Color aStartColor, aEndColor; if( bSymmetric ) { diff --git a/sd/qa/unit/data/xml/n762695_0.xml b/sd/qa/unit/data/xml/n762695_0.xml index 99ce6435f18d..2725854df0cc 100644 --- a/sd/qa/unit/data/xml/n762695_0.xml +++ b/sd/qa/unit/data/xml/n762695_0.xml @@ -88,7 +88,7 @@ - + @@ -165,7 +165,7 @@ - +