diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-03-02 10:39:33 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2018-03-04 12:11:09 +0100 |
commit | 35d062f7879d5414334643cb90bff411726b2168 (patch) | |
tree | 9d04dcd4ec3c504b1d6a3e250883e0ce4033d518 /oox/source | |
parent | 0a3151314ad78b86bbb4bd76bac678fbaa9caf06 (diff) |
tdf#116163: Limit label height in chart if needed
Change-Id: Ia84fd0c3b76886bc6124dc3b59035465aa31b020
Reviewed-on: https://gerrit.libreoffice.org/50700
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/export/chartexport.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 81ed22c57996..424d479b0090 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2325,11 +2325,25 @@ void ChartExport::exportShapeProps( const Reference< XPropertySet >& xPropSet ) pFS->endElement( FSNS( XML_c, XML_spPr ) ); } -void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet) +void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet, bool bAxis) { FSHelperPtr pFS = GetFS(); pFS->startElement(FSNS(XML_c, XML_txPr), FSEND); - pFS->singleElement( FSNS( XML_a, XML_bodyPr ), FSEND ); + + sal_Int32 nRotation = 0; + if (bAxis) + { + double fTextRotation = 0; + uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); + if (aAny.hasValue() && (aAny >>= fTextRotation)) + nRotation = fTextRotation * -600.0; + } + + if (nRotation) + pFS->singleElement(FSNS(XML_a, XML_bodyPr), XML_rot, I32S(nRotation), FSEND); + else + pFS->singleElement(FSNS(XML_a, XML_bodyPr), FSEND); + pFS->singleElement( FSNS( XML_a, XML_lstStyle ), FSEND ); pFS->startElement(FSNS(XML_a, XML_p), FSEND); @@ -2736,7 +2750,7 @@ void ChartExport::_exportAxis( // shape properties exportShapeProps( xAxisProp ); - exportTextProps(xAxisProp); + exportTextProps(xAxisProp, true); pFS->singleElement( FSNS( XML_c, XML_crossAx ), XML_val, I32S( rAxisIdPair.nCrossAx ), |