summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-29 20:28:18 +0200
committerJacobo Aragunde Pérez <jaragunde@igalia.com>2014-04-30 16:46:10 +0200
commitf519bfdef11d7b14fbdc7bdbeb286783e08416ed (patch)
tree2f225721bb624f63d74c83c45e93f66b69bd06a9 /oox
parent9a61470eb1fa161cba70f2e9c4ea8817dc7f617e (diff)
ooxml: Preserve reflection effect on shapes.
Reused most of the code of other effects, but adding some new attributes specific for this effect. Finally, modified an existing unit test to add a check for reflection. Change-Id: Iffd0c1203e9c66a8d7b7f748d98d9c3ef01c7bbf
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/effectpropertiescontext.cxx20
-rw-r--r--oox/source/export/drawingml.cxx35
2 files changed, 53 insertions, 2 deletions
diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx
index 8a2a6f49df88..6699678a017a 100644
--- a/oox/source/drawingml/effectpropertiescontext.cxx
+++ b/oox/source/drawingml/effectpropertiescontext.cxx
@@ -65,6 +65,21 @@ void EffectPropertiesContext::saveUnsupportedAttribs( const AttributeList& rAttr
if( rAttribs.hasAttribute( XML_rad ) )
mrEffectProperties.appendUnsupportedEffectAttrib( "rad",
makeAny( rAttribs.getInteger( XML_rad, 0 ) ) );
+ if( rAttribs.hasAttribute( XML_endA ) )
+ mrEffectProperties.appendUnsupportedEffectAttrib( "endA",
+ makeAny( rAttribs.getInteger( XML_endA, 0 ) ) );
+ if( rAttribs.hasAttribute( XML_endPos ) )
+ mrEffectProperties.appendUnsupportedEffectAttrib( "endPos",
+ makeAny( rAttribs.getInteger( XML_endPos, 0 ) ) );
+ if( rAttribs.hasAttribute( XML_fadeDir ) )
+ mrEffectProperties.appendUnsupportedEffectAttrib( "fadeDir",
+ makeAny( rAttribs.getInteger( XML_fadeDir, 0 ) ) );
+ if( rAttribs.hasAttribute( XML_stA ) )
+ mrEffectProperties.appendUnsupportedEffectAttrib( "stA",
+ makeAny( rAttribs.getInteger( XML_stA, 0 ) ) );
+ if( rAttribs.hasAttribute( XML_stPos ) )
+ mrEffectProperties.appendUnsupportedEffectAttrib( "stPos",
+ makeAny( rAttribs.getInteger( XML_stPos, 0 ) ) );
}
ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
@@ -93,11 +108,14 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement,
break;
case A_TOKEN( glow ):
case A_TOKEN( softEdge ):
+ case A_TOKEN( reflection ):
{
if( nElement == A_TOKEN( glow ) )
mrEffectProperties.msUnsupportedEffectName = "glow";
- else
+ else if( nElement == A_TOKEN( softEdge ) )
mrEffectProperties.msUnsupportedEffectName = "softEdge";
+ else if( nElement == A_TOKEN( reflection ) )
+ mrEffectProperties.msUnsupportedEffectName = "reflection";
saveUnsupportedAttribs( rAttribs );
return new ColorContext( *this, mrEffectProperties.maShadow.moShadowColor );
}
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 84a6e0fa6edc..8cf14e3723b8 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2101,7 +2101,8 @@ void DrawingML::WriteShapeEffects( Reference< XPropertySet > rXPropSet )
for( sal_Int32 i=0; i < aEffectProps.getLength(); ++i )
{
if( aEffectProps[i].Name == "outerShdw" || aEffectProps[i].Name == "innerShdw"
- || aEffectProps[i].Name == "glow" || aEffectProps[i].Name == "softEdge" )
+ || aEffectProps[i].Name == "glow" || aEffectProps[i].Name == "softEdge"
+ || aEffectProps[i].Name == "reflection" )
{
// assign the proper tag and enable bContainsColor if necessary
if( aEffectProps[i].Name == "outerShdw" )
@@ -2121,6 +2122,8 @@ void DrawingML::WriteShapeEffects( Reference< XPropertySet > rXPropSet )
}
else if( aEffectProps[i].Name == "softEdge" )
nEffectToken = FSNS( XML_a, XML_softEdge );
+ else if( aEffectProps[i].Name == "reflection" )
+ nEffectToken = FSNS( XML_a, XML_reflection );
// read tag attributes
uno::Sequence< beans::PropertyValue > aOuterShdwProps;
@@ -2187,6 +2190,36 @@ void DrawingML::WriteShapeEffects( Reference< XPropertySet > rXPropSet )
aOuterShdwProps[j].Value >>= nVal;
aOuterShdwAttrList->add( XML_rad, OString::number( nVal ).getStr() );
}
+ else if( aOuterShdwProps[j].Name == "endA" )
+ {
+ sal_Int32 nVal = 0;
+ aOuterShdwProps[j].Value >>= nVal;
+ aOuterShdwAttrList->add( XML_endA, OString::number( nVal ).getStr() );
+ }
+ else if( aOuterShdwProps[j].Name == "endPos" )
+ {
+ sal_Int32 nVal = 0;
+ aOuterShdwProps[j].Value >>= nVal;
+ aOuterShdwAttrList->add( XML_endPos, OString::number( nVal ).getStr() );
+ }
+ else if( aOuterShdwProps[j].Name == "fadeDir" )
+ {
+ sal_Int32 nVal = 0;
+ aOuterShdwProps[j].Value >>= nVal;
+ aOuterShdwAttrList->add( XML_fadeDir, OString::number( nVal ).getStr() );
+ }
+ else if( aOuterShdwProps[j].Name == "stA" )
+ {
+ sal_Int32 nVal = 0;
+ aOuterShdwProps[j].Value >>= nVal;
+ aOuterShdwAttrList->add( XML_stA, OString::number( nVal ).getStr() );
+ }
+ else if( aOuterShdwProps[j].Name == "stPos" )
+ {
+ sal_Int32 nVal = 0;
+ aOuterShdwProps[j].Value >>= nVal;
+ aOuterShdwAttrList->add( XML_stPos, OString::number( nVal ).getStr() );
+ }
}
}
else if(aEffectProps[i].Name == "ShadowRgbClr")