diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 01:23:36 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-04-25 02:17:46 +0200 |
commit | d55cb0845a094601dcc0149e9a59e360021d231c (patch) | |
tree | ff15b7fdcb056dcf68b46b596f62a54e166e3f55 | |
parent | bee3934bb68f38e89bb33f75f405099ca08d59a9 (diff) |
export title rotation, tdf#75015
Change-Id: I4ab3aeefb7ce58786a034798aa09b92a81791770
-rw-r--r-- | oox/source/export/chartexport.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index e53540e3acdc..80bcfba7ff57 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1011,6 +1011,26 @@ void ChartExport::exportLegend( Reference< ::com::sun::star::chart::XChartDocume 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( Reference< XShape > xShape ) { OUString sText; @@ -1038,8 +1058,12 @@ void ChartExport::exportTitle( Reference< XShape > xShape ) if( bVertical ) sWritingMode = "wordArtVert"; + sal_Int32 nRotation; + xPropSet->getPropertyValue("TextRotation") >>= nRotation; + pFS->singleElement( FSNS( XML_a, XML_bodyPr ), XML_vert, sWritingMode, + XML_rot, nRotation == 0 ? NULL : calcRotationValue(nRotation).getStr(), FSEND ); // TODO: lstStyle pFS->singleElement( FSNS( XML_a, XML_lstStyle ), |