summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-03-02 10:39:33 +0100
committerAndras Timar <andras.timar@collabora.com>2018-03-22 10:29:52 +0100
commit7b80e54640e20657402656614228998e0544a842 (patch)
tree0ecd6ab353d53fc6002a0615d77b83af526183f3 /oox
parent2d8d36713790584b4ab7f5c94179bad05754b2ec (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> Reviewed-on: https://gerrit.libreoffice.org/50913 Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/chartexport.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index b9a703cafd4b..c4c979df04bb 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2417,11 +2417,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);
@@ -2829,7 +2843,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 ),