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

Paul Trojahn paul.trojahn at gmail.com
Mon Jul 17 10:12:15 UTC 2017


 oox/source/drawingml/fillproperties.cxx |    4 ++--
 sd/qa/unit/data/xml/n762695_0.xml       |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 41f098c0a2363f7607516a9fe20706ad4201b45c
Author: Paul Trojahn <paul.trojahn at gmail.com>
Date:   Tue Jul 4 19:38:31 2017 +0200

    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 <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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 @@
  </XShape>
  <XShape positionX="5291" positionY="7175" sizeX="1419" sizeY="1450" type="com.sun.star.drawing.CustomShape" name="Left Arrow 9" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="GRADIENT" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
   <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
-  <FillGradient style="LINEAR" startColor="b29dde" endColor="ffffff" angle="450" border="0" xOffset="0" yOffset="0" startIntensity="100" endIntensity="100" stepCount="0"/>
+  <FillGradient style="LINEAR" startColor="b29dde" endColor="ffffff" angle="1350" border="0" xOffset="0" yOffset="0" startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
   <FillBitmap width="32" height="32"/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
@@ -165,7 +165,7 @@
  </XShape>
  <XShape positionX="18620" positionY="6171" sizeX="1418" sizeY="1450" type="com.sun.star.drawing.CustomShape" name="Left Arrow 13" fontHeight="24.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="GRADIENT" fillColor="729fcf" fillTransparence="0" fillTransparenceGradientName="">
   <FillTransparenceGradient style="LINEAR" startColor="000000" endColor="ffffff" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/>
-  <FillGradient style="LINEAR" startColor="b29dde" endColor="ffffff" angle="2250" border="0" xOffset="0" yOffset="0" startIntensity="100" endIntensity="100" stepCount="0"/>
+  <FillGradient style="LINEAR" startColor="b29dde" endColor="ffffff" angle="3150" border="0" xOffset="0" yOffset="0" startIntensity="100" endIntensity="100" stepCount="0"/>
   <FillHatch style="SINGLE" color="3465a4" distance="20" angle="0"/>
   <FillBitmap width="32" height="32"/>
   <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>


More information about the Libreoffice-commits mailing list