summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLTextFrameContext.cxx8
-rw-r--r--xmloff/source/text/txtparae.cxx5
2 files changed, 11 insertions, 2 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 63ea2aa937f7..25b6b0441cf5 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1027,6 +1027,14 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl(
// to me mirrored using * -1.0, see conversion there)
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
+ // no loop needed here. nRotation is used in setPropertyValue("GraphicRotation")
+ // and *has* to be in the range [0 .. 3600[
+ if(nRotation < 0)
+ {
+ nRotation += 3600;
+ }
}
}
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 70859d4c4779..16a57ed09d23 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3078,13 +3078,14 @@ 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) * (M_PI/1800.0));
+ const double fRotate(static_cast< double >(-nRotation) * (F_PI/1800.0));
// transform to rotation center which is the object's center
aSdXMLImExTransform2D.AddTranslate(-aCenter);
// add rotation itself
- aSdXMLImExTransform2D.AddRotate(fRotate);
+ // tdf#115529 but correct value modulo 2PI to have it positive and in the range of [0.0 .. 2PI[
+ aSdXMLImExTransform2D.AddRotate(basegfx::normalizeToRange(fRotate, F_2PI));
// back-transform after rotation
aSdXMLImExTransform2D.AddTranslate(aCenter);