diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-08 11:47:42 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-05-08 14:37:51 +0200 |
commit | c94d7b8a9aafc51ce33e74c6102c9b54a07a6b16 (patch) | |
tree | 8c67756ffa309e15473d709a02e87026f673a210 /oox | |
parent | 7aedeab27cbef89fd3f831b4a1ef2c06f24c9790 (diff) |
tdf#132201: use proper sequence order of effects per spec
See CT_EffectList in ECMA-376
Change-Id: Ib0605f1e4a0795d2bfdbb6b7451a902c67ea504d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93717
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index aebd6901c864..e2149b648f84 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3742,6 +3742,9 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) } } + // tdf#132201: the order of effects is important. Effects order (CT_EffectList in ECMA-376): + // blur -> fillOverlay -> glow -> innerShdw -> outerShdw -> prstShdw -> reflection -> softEdge + if( !aEffects.hasElements() ) { bool bHasShadow = false; @@ -3755,6 +3758,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) if( bHasShadow || bHasGlow ) { mpFS->startElementNS(XML_a, XML_effectLst); + WriteGlowEffect(rXPropSet); if( bHasShadow ) { Sequence< PropertyValue > aShadowGrabBag( 3 ); @@ -3778,7 +3782,6 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) WriteShapeEffect( "outerShdw", aShadowGrabBag ); } - WriteGlowEffect(rXPropSet); mpFS->endElementNS(XML_a, XML_effectLst); } } @@ -3820,8 +3823,18 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) } mpFS->startElementNS(XML_a, XML_effectLst); + bool bGlowWritten = false; for( const auto& rEffect : std::as_const(aEffects) ) { + if (!bGlowWritten + && (rEffect.Name == "innerShdw" || rEffect.Name == "outerShdw" + || rEffect.Name == "prstShdw" || rEffect.Name == "reflection" + || rEffect.Name == "softEdge")) + { + WriteGlowEffect(rXPropSet); + bGlowWritten = true; + } + if( rEffect.Name == "outerShdw" ) { WriteShapeEffect( rEffect.Name, aOuterShdwProps ); @@ -3833,7 +3846,8 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) WriteShapeEffect( rEffect.Name, aEffectProps ); } } - WriteGlowEffect(rXPropSet); + if (!bGlowWritten) + WriteGlowEffect(rXPropSet); mpFS->endElementNS(XML_a, XML_effectLst); } |