diff options
author | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-16 11:38:18 +0200 |
---|---|---|
committer | Jacobo Aragunde Pérez <jaragunde@igalia.com> | 2014-05-16 14:11:23 +0200 |
commit | 73ad72e820ed3de346efa1914432a7f2c6264dde (patch) | |
tree | 9a4bb88d177629f27fb46656ac2b178cb036ca55 /writerfilter | |
parent | be415a0f9a65d44d1042b313141f49c617bedd93 (diff) |
ooxml: Preserve effects on pictures
If a picture contains some 2D (glow, shadow...) or 3D effect
(rotation, extrusion...), we prevent the importer from transforming
it into a XTextContent so the XShape grab bag is not removed and
the effects are preserved using the existing mechanisms. Added a unit
test for this issue, and modified some existing unit tests to match
the new behaviour.
Change-Id: I3b87069ea208604383a592d34d0a4ceb6b0f9fc7
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 10c7029acd60..59f27fc5cd6e 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -643,6 +643,17 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) sal_Int32 nRotation = 0; xShapeProps->getPropertyValue("RotateAngle") >>= nRotation; + ::css::beans::PropertyValues aGrabBag; + bool bContainsEffects = false; + xShapeProps->getPropertyValue("InteropGrabBag") >>= aGrabBag; + for( sal_Int32 i = 0; i < aGrabBag.getLength(); ++i ) + { + // if the shape contains effects in the grab bag, we should not transform it + // in a XTextContent so those effects can be preserved + if( aGrabBag[i].Name == "EffectProperties" || aGrabBag[i].Name == "3DEffectProperties" ) + bContainsEffects = true; + } + ::com::sun::star::beans::PropertyValues aMediaProperties( 1 ); aMediaProperties[0].Name = "URL"; aMediaProperties[0].Value <<= sUrl; @@ -661,7 +672,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) xShapeProps->getPropertyValue("AdjustContrast") >>= m_pImpl->nContrast; // fdo#70457: transform XShape into a SwXTextGraphicObject only if there's no rotation - if ( nRotation == 0 ) + if ( nRotation == 0 && !bContainsEffects ) m_xGraphicObject = createGraphicObject( aMediaProperties ); bUseShape = !m_xGraphicObject.is( ); |