File bsc1153624.patch of Package libreoffice

From 6e0080e622094e8fcfbca942e38b89f44ec587d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCl=C5=9Fah=20K=C3=B6se?= <gulsah.kose@collabora.com>
Date: Wed, 27 Nov 2019 13:35:29 +0300
Subject: [PATCH 1/2] tdf#127090 Export textbox rotation attribute.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In case "rotated textbox in a custom shape" handle
draw:text-rotate-angle attribute while exporting
ODP to PPTX.

Change-Id: I13b99da586af5e77e51a7cc93a751ab21bed7170
Reviewed-on: https://gerrit.libreoffice.org/83888
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/84023
Reviewed-by: Andras Timar <andras.timar@collabora.com>
---
 oox/source/export/drawingml.cxx    |  14 ++++++++------
 sd/qa/unit/data/pptx/tdf127090.odp | Bin 0 -> 12415 bytes
 sd/qa/unit/export-tests-ooxml1.cxx |  14 ++++++++++++++
 3 files changed, 22 insertions(+), 6 deletions(-)
 create mode 100644 sd/qa/unit/data/pptx/tdf127090.odp

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 9ac4fd744963..79f8dd76960c 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2537,7 +2537,8 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
     if( !xXText.is() )
         return;

-    sal_Int32 nTextRotateAngle = 0;
+    double nTextRotateAngle = 0;
+    sal_Int32 nTextPreRotateAngle = 0;

 #define DEFLRINS 254
 #define DEFTBINS 127
@@ -2578,20 +2579,21 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
         {
             for ( sal_Int32 i = 0, nElems = aProps.getLength(); i < nElems; ++i )
             {
-                if ( aProps[ i ].Name == "TextPreRotateAngle" && ( aProps[ i ].Value >>= nTextRotateAngle ) )
+                if ( aProps[ i ].Name == "TextPreRotateAngle" && ( aProps[ i ].Value >>= nTextPreRotateAngle ) )
                 {
-                    if ( nTextRotateAngle == -90 )
+                    if ( nTextPreRotateAngle == -90 )
                     {
                         sWritingMode = "vert";
                         bVertical = true;
                     }
-                    else if ( nTextRotateAngle == -270 )
+                    else if ( nTextPreRotateAngle == -270 )
                     {
                         sWritingMode = "vert270";
                         bVertical = true;
                     }
-                    break;
                 }
+                else if( aProps[ i ].Name == "TextRotateAngle" )
+                    aProps[ i ].Value >>= nTextRotateAngle;
             }
         }
     }
@@ -2634,7 +2636,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
                                XML_anchor, sVerticalAlignment,
                                XML_anchorCtr, bHorizontalCenter ? "1" : nullptr,
                                XML_vert, sWritingMode,
-                               XML_rot, (nTextRotateAngle != 0) ? oox::drawingml::calcRotationValue( nTextRotateAngle * 100 ).getStr() : nullptr,
+                               XML_rot, (nTextPreRotateAngle + nTextRotateAngle != 0) ? oox::drawingml::calcRotationValue( (nTextPreRotateAngle + nTextRotateAngle) * 100 ).getStr() : nullptr,
                                FSEND );
         if( !presetWarp.isEmpty())
         {