summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-10-06 16:04:25 +0200
committerAndras Timar <andras.timar@collabora.com>2017-11-01 07:22:27 +0100
commitea524432686ca8779c7aba0144d8a72e1b03fa83 (patch)
tree28f1b4ac8c4d6fe3ba1385801befe3b1bda43982 /oox
parentd4a84bf09c42faa7e0954477834cd4c4e83248f5 (diff)
SmartArt: export text rotation in the PPTX
Change-Id: I74bfc172fe7434d14de468ecfd3412636e53780c Reviewed-on: https://gerrit.libreoffice.org/43202 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 3cbb6e73ecbff5d83be817c0dab680c5d925c6fa) Reviewed-on: https://gerrit.libreoffice.org/43984 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx22
-rw-r--r--oox/source/export/drawingml.cxx4
2 files changed, 4 insertions, 22 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index b1e9368d7c7a..18b9a02bcd0d 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1030,26 +1030,6 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x
pFS->endElement( FSNS( XML_c, XML_legend ) );
}
-namespace {
-
-/**
- * nRotation is a 100th of a degree and the return value is
- * in a 60,000th of a degree
- *
- * Also rotation is in opposite directions so multiply with -1
- */
-OString calcRotationValue(sal_Int32 nRotation)
-{
- if (nRotation > 18000) // 180 degree
- {
- nRotation -= 36000;
- }
- nRotation *= -600;
- return OString::number(nRotation);
-}
-
-}
-
void ChartExport::exportTitle( const Reference< XShape >& xShape )
{
OUString sText;
@@ -1082,7 +1062,7 @@ void ChartExport::exportTitle( const Reference< XShape >& xShape )
pFS->singleElement( FSNS( XML_a, XML_bodyPr ),
XML_vert, sWritingMode,
- XML_rot, calcRotationValue(nRotation).getStr(),
+ XML_rot, oox::drawingml::calcRotationValue(nRotation).getStr(),
FSEND );
// TODO: lstStyle
pFS->singleElement( FSNS( XML_a, XML_lstStyle ),
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 444f26b0405e..7a142d9ed8bc 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2193,6 +2193,8 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
if( !xXText.is() )
return;
+ sal_Int32 nTextRotateAngle = 0;
+
#define DEFLRINS 254
#define DEFTBINS 127
sal_Int32 nLeft, nRight, nTop, nBottom;
@@ -2232,7 +2234,6 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin
{
for ( sal_Int32 i = 0, nElems = aProps.getLength(); i < nElems; ++i )
{
- sal_Int32 nTextRotateAngle = 0;
if ( aProps[ i ].Name == "TextPreRotateAngle" && ( aProps[ i ].Value >>= nTextRotateAngle ) )
{
if ( nTextRotateAngle == -90 )
@@ -2289,6 +2290,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,
FSEND );
if( !presetWarp.isEmpty())
{