diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2018-12-15 10:06:03 +0100 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2018-12-18 16:53:24 +0100 |
commit | 527772d8dfcedad56b11b5b13540ec1defa464e5 (patch) | |
tree | 3036cc99827cd8940d92d4ae54be4e0971d9525b /oox | |
parent | 4575cc2bc0c6611294849132ff216995bfc07bf3 (diff) |
tdf#122090 Chart: Fix OOXML export of X axis labels rotation
The MS Office UI allows values only in range of [-90,90].
Because of this, we should reflect the angle if the Textrotation
is between 90 and 270 degree. Also we have to recalculated the
the Textrotation between 270 and 360 degree, because the OOXML
counts clockwise.
Change-Id: I2fbd53d93ab2e8ea4e26840fd056de20b337daa3
Reviewed-on: https://gerrit.libreoffice.org/65194
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/chartexport.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index ce3c6984ad40..00b631688b14 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -2366,10 +2366,22 @@ void ChartExport::exportTextProps(const Reference<XPropertySet>& xPropSet) if (fMultiplier) { - double fTextRotation = 0; + double fTextRotation = 0.0; uno::Any aAny = xPropSet->getPropertyValue("TextRotation"); if (aAny.hasValue() && (aAny >>= fTextRotation)) + { + // The MS Office UI allows values only in range of [-90,90]. + if (fTextRotation > 9000.0 && fTextRotation < 27000.0) + { + // Reflect the angle if the value is between 90° and 270° + fTextRotation -= 18000.0; + } + else if (fTextRotation >=27000.0) + { + fTextRotation -= 36000.0; + } nRotation = std::round(fTextRotation * fMultiplier); + } } } |