summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de (CIB)>2018-02-20 15:55:49 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-02-21 10:26:33 +0100
commit91374342ba491234a46aeb4b554b5e379869f301 (patch)
tree252ef7711c0727fd906b4ad78934a8263467c316
parent53e168893846d5a9761bf37c299bc2a5f135c021 (diff)
tdf#115782: Need to use mirrored rotation in ODF
To be compatible with the orientation of rotations in ODF format in current state (which is wrong oriented) we have to do the same as in all other places (unfortunately). Change-Id: I2f02019b91a0f6020612c9c09be2d247e1b1deb1 Reviewed-on: https://gerrit.libreoffice.org/50047 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> (cherry picked from commit ea360461746f37be021b63da7a64a60d0f3c4af4) Reviewed-on: https://gerrit.libreoffice.org/50072 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx5
-rw-r--r--xmloff/source/text/txtparae.cxx4
2 files changed, 7 insertions, 2 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 118207cd00a4..876e4f1f82a4 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1024,7 +1024,10 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
// value is already mirrored, so do not do it again here (to be in sync
// with XMLTextParagraphExport::_exportTextGraphic normally it would need
// to me mirrored using * -1.0, see conversion there)
- const double fRotate(aDecomposedTransform.getRotate() * (1800.0/M_PI));
+ // CAUTIONII: Due to tdf#115782 it is better for current ODF to indeed use it
+ // with the wrong orientation as in all other cases - ARGH! We will need to
+ // correct this in future ODF ASAP! For now, mirror the rotation here AGAIN
+ const double fRotate(aDecomposedTransform.getRotate() * (-1800.0/M_PI));
nRotation = static_cast< sal_Int16 >(basegfx::fround(fRotate) % 3600);
// tdf#115519 may be negative, with the above modulo maximal -3599, so
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 89351f976236..47df502fb451 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3082,7 +3082,9 @@ void XMLTextParagraphExport::_exportTextGraphic(
// we have a right-handed coordinate system, so need to correct this by mirroring
// the rotation to get the correct transformation. See also case XML_TOK_TEXT_FRAME_TRANSFORM
// in XMLTextFrameContext_Impl::XMLTextFrameContext_Impl and #i78696#
- const double fRotate(static_cast< double >(-nRotation) * (F_PI/1800.0));
+ // CAUTIONII: Due to tdf#115782 it is better for current ODF to indeed write it with the wrong
+ // orientation as in all other cases - ARGH! We will need to correct this in future ODF ASAP!
+ const double fRotate(static_cast< double >(nRotation) * (F_PI/1800.0));
// transform to rotation center which is the object's center
aSdXMLImExTransform2D.AddTranslate(-aCenter);