From ebd391767d70903e6a4ea7e213f475af94e183ec Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 23 May 2020 19:54:14 +0300 Subject: tdf#101181: drop useless "GlowEffect" boolean property Just use GlowEffectRad to indicate effect presense: radius of 0 means effect is disabled. Change-Id: Ic06bba34f5a851f120d3d00cb7e20c429ead9ee1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94732 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- oox/source/drawingml/shape.cxx | 1 - oox/source/export/drawingml.cxx | 16 +++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index cd7c289e9efa..b7e855058e6a 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1470,7 +1470,6 @@ Reference< XShape > const & Shape::createAndInsert( if ( aEffectProperties.maGlow.moGlowRad.has() ) { uno::Reference propertySet (mxShape, uno::UNO_QUERY); - propertySet->setPropertyValue("GlowEffect", makeAny(true)); propertySet->setPropertyValue("GlowEffectRad", makeAny(convertEmuToHmm(aEffectProperties.maGlow.moGlowRad.get()))); propertySet->setPropertyValue("GlowEffectColor", makeAny(aEffectProperties.maGlow.moGlowColor.getColor(rGraphicHelper))); propertySet->setPropertyValue("GlowEffectTransparency", makeAny(aEffectProperties.maGlow.moGlowColor.getTransparency())); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 63fec0d6d18c..0be37c8748f0 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3756,8 +3756,12 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) if( GetProperty( rXPropSet, "Shadow" ) ) mAny >>= bHasShadow; bool bHasEffects = bHasShadow; - if (!bHasEffects && GetProperty(rXPropSet, "GlowEffect")) - mAny >>= bHasEffects; + if (!bHasEffects && GetProperty(rXPropSet, "GlowEffectRad")) + { + sal_Int32 rad = 0; + mAny >>= rad; + bHasEffects = rad > 0; + } if (!bHasEffects && GetProperty(rXPropSet, "SoftEdgeRad")) { sal_Int32 rad = 0; @@ -3867,13 +3871,11 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) void DrawingML::WriteGlowEffect(const Reference< XPropertySet >& rXPropSet) { - bool hasGlow = false; - rXPropSet->getPropertyValue("GlowEffect") >>= hasGlow; - if(!hasGlow) - return; - sal_Int32 nRad = 0; rXPropSet->getPropertyValue("GlowEffectRad") >>= nRad; + if (!nRad) + return; + Sequence< PropertyValue > aGlowAttribs(1); aGlowAttribs[0].Name = "rad"; aGlowAttribs[0].Value <<= oox::drawingml::convertHmmToEmu(nRad); -- cgit