diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de (CIB)> | 2018-02-15 15:41:50 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-02-19 14:46:40 +0100 |
commit | 58607318bf39053d2f20d47ae8e3e69e6b3eeb04 (patch) | |
tree | da9e8812c410c61a1148fda16ca90ee3b0922aad /xmloff | |
parent | f8afdb8ba99074a85b331065b4642081467557ec (diff) |
tdf#115519: Handle rotation for WriterFlyFrames correctly
Adapted due to no transformation is written here, but still
controlling the values of persistent data is a good thing.
Change-Id: I5f29b3640eaf24d63c64edfecd6732f336582640
Reviewed-on: https://gerrit.libreoffice.org/49826
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Reviewed-on: https://gerrit.libreoffice.org/49897
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 11 |
2 files changed, 19 insertions, 0 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index e7f81a6e6d27..2e0a50bb3f6b 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1058,6 +1058,14 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( { // RotGrfFlyFrame: is in 10th degrees nRotation = (sal_Int16)(nVal % 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 41bd0d503898..763058f270b7 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3092,6 +3092,17 @@ void XMLTextParagraphExport::_exportTextGraphic( rPropSet->getPropertyValue( sGraphicRotation ) >>= nVal; if( nVal != 0 ) { + // tdf#115519 may be bigger 3600 or negative, + // correct to range [0 .. 3600[ + if(nVal > 0) + { + nVal %= 3600; + } + else if(nVal < 0) + { + nVal = (nVal % 3600) + 3600; + } + OUStringBuffer sRet( GetXMLToken(XML_ROTATE).getLength()+4 ); sRet.append( GetXMLToken(XML_ROTATE)); sRet.append( '(' ); |