diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2013-10-29 19:10:40 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-14 12:46:21 +0100 |
commit | 5c7ede91afaf334cd6faa099ae3f7c1d6cc929c8 (patch) | |
tree | f9ea43b037b41eefb701dd41bfd82b3b395fb79e /writerfilter | |
parent | 8e0aec74cadcc7ad0fe38d52f542c6a6643308ae (diff) |
fdo#70457: Preserve rotation of embedded bitmaps from docx
When importing bitmaps coming from VML code, we were mistakenly ignoring
rotation information: we have just added it to the existing XShape object.
In the case of bitmaps expressed in DrawingML, the code was transforming
them into SwXTextGraphicObjects which don't have rotation information.
We are now preventing that transformation when rotation value differs from
zero, leaving the XShape object that was built in the first pass through
the document.
Added a unit test.
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/6484
Change-Id: I40100f8919894e48c005f8ed445bb5cad4f58d8b
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index ff3409c80145..7e1a42ecdf6f 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -908,6 +908,9 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) OUString sUrl; xShapeProps->getPropertyValue("GraphicURL") >>= sUrl; + sal_Int32 nRotation; + xShapeProps->getPropertyValue("RotateAngle") >>= nRotation; + ::com::sun::star::beans::PropertyValues aMediaProperties( 1 ); aMediaProperties[0].Name = "URL"; aMediaProperties[0].Value <<= sUrl; @@ -921,7 +924,9 @@ void GraphicImport::lcl_attribute(Id nName, Value & val) xShapeProps->getPropertyValue("ShadowTransparence") >>= m_pImpl->nShadowTransparence; } - m_xGraphicObject = createGraphicObject( aMediaProperties ); + // fdo#70457: transform XShape into a SwXTextGraphicObject only if there's no rotation + if ( nRotation == 0 ) + m_xGraphicObject = createGraphicObject( aMediaProperties ); bUseShape = !m_xGraphicObject.is( ); |