diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2018-12-15 10:06:03 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-12-18 22:41:25 +0100 |
commit | 6991784d9759ebfe0686f96a242d091799f81012 (patch) | |
tree | eb5160090fca14d631a86c2fad0faae47c8eab77 /oox | |
parent | 0cd4c92b56fb6259f8f3188fd50c315993883d2e (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>
(cherry picked from commit 527772d8dfcedad56b11b5b13540ec1defa464e5)
Reviewed-on: https://gerrit.libreoffice.org/65351
Reviewed-by: Balazs Varga <balazs.varga991@gmail.com>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
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 08b296f57cb6..706f6c60265f 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); + } } } |