summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-30 11:18:49 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-30 16:46:10 +0200
commit2310af236659f4fdd4c26b1e277e568d04a20687 (patch)
tree780b478dec8d85c508a7f7cae8ac73f04b831a89 /oox
parentooxml: Preserve reflection effect on shapes. (diff)
downloadcore-2310af236659f4fdd4c26b1e277e568d04a20687.tar.gz
core-2310af236659f4fdd4c26b1e277e568d04a20687.zip
ooxml: Preserve blur effect on shapes.
Reused the code for other effects just adding the new attribute "grow". I didn't add a unit test for this effect because I found no way to apply it to an object in Word, but it's technically part of the standard. Change-Id: I391aff17f59d49d6bf339a71481dcdb51c537c9e
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/effectpropertiescontext.cxx6
-rw-r--r--oox/source/export/drawingml.cxx10
2 files changed, 15 insertions, 1 deletions
diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx
index 6699678a017a..2493ec94c3de 100644
--- a/oox/source/drawingml/effectpropertiescontext.cxx
+++ b/oox/source/drawingml/effectpropertiescontext.cxx
@@ -80,6 +80,9 @@ void EffectPropertiesContext::saveUnsupportedAttribs( const AttributeList& rAttr
if( rAttribs.hasAttribute( XML_stPos ) )
mrEffectProperties.appendUnsupportedEffectAttrib( "stPos",
makeAny( rAttribs.getInteger( XML_stPos, 0 ) ) );
+ if( rAttribs.hasAttribute( XML_grow ) )
+ mrEffectProperties.appendUnsupportedEffectAttrib( "grow",
+ makeAny( rAttribs.getInteger( XML_grow, 0 ) ) );
}
ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
@@ -109,6 +112,7 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
case A_TOKEN( glow ):
case A_TOKEN( softEdge ):
case A_TOKEN( reflection ):
+ case A_TOKEN( blur ):
{
if( nElement == A_TOKEN( glow ) )
mrEffectProperties.msUnsupportedEffectName = "glow";
@@ -116,6 +120,8 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
mrEffectProperties.msUnsupportedEffectName = "softEdge";
else if( nElement == A_TOKEN( reflection ) )
mrEffectProperties.msUnsupportedEffectName = "reflection";
+ else if( nElement == A_TOKEN( blur ) )
+ mrEffectProperties.msUnsupportedEffectName = "blur";
saveUnsupportedAttribs( rAttribs );
return new ColorContext( *this, mrEffectProperties.maShadow.moShadowColor );
}
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8cf14e3723b8..a1f00fd05ddf 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2102,7 +2102,7 @@ void DrawingML::WriteShapeEffects( Reference< XPropertySet > rXPropSet )
{
if( aEffectProps[i].Name == "outerShdw" || aEffectProps[i].Name == "innerShdw"
|| aEffectProps[i].Name == "glow" || aEffectProps[i].Name == "softEdge"
- || aEffectProps[i].Name == "reflection" )
+ || aEffectProps[i].Name == "reflection" || aEffectProps[i].Name == "blur" )
{
// assign the proper tag and enable bContainsColor if necessary
if( aEffectProps[i].Name == "outerShdw" )
@@ -2124,6 +2124,8 @@ void DrawingML::WriteShapeEffects( Reference< XPropertySet > rXPropSet )
nEffectToken = FSNS( XML_a, XML_softEdge );
else if( aEffectProps[i].Name == "reflection" )
nEffectToken = FSNS( XML_a, XML_reflection );
+ else if( aEffectProps[i].Name == "blur" )
+ nEffectToken = FSNS( XML_a, XML_blur );
// read tag attributes
uno::Sequence< beans::PropertyValue > aOuterShdwProps;
@@ -2220,6 +2222,12 @@ void DrawingML::WriteShapeEffects( Reference< XPropertySet > rXPropSet )
aOuterShdwProps[j].Value >>= nVal;
aOuterShdwAttrList->add( XML_stPos, OString::number( nVal ).getStr() );
}
+ else if( aOuterShdwProps[j].Name == "grow" )
+ {
+ sal_Int32 nVal = 0;
+ aOuterShdwProps[j].Value >>= nVal;
+ aOuterShdwAttrList->add( XML_grow, OString::number( nVal ).getStr() );
+ }
}
}
else if(aEffectProps[i].Name == "ShadowRgbClr")