From a640676e06bdab3471f5c9f04dd9403bc66ddc22 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 7 May 2020 15:40:57 +0300 Subject: tdf#101181: store glow radius in 100ths of mm instead of EMUs ... as we do for all metric values. This fixes storing values like "190.5cm" in ODF for 15 pt (should be "0.529cm"). Change-Id: I382756af56464424dcb24ed8801d0a4203658c11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93640 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- oox/source/drawingml/shape.cxx | 2 +- oox/source/export/drawingml.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 959f99ecffb4..92629b2419b5 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1470,7 +1470,7 @@ Reference< XShape > const & Shape::createAndInsert( { uno::Reference propertySet (mxShape, uno::UNO_QUERY); propertySet->setPropertyValue("GlowEffect", makeAny(true)); - propertySet->setPropertyValue("GlowEffectRad", makeAny(static_cast(aEffectProperties.maGlow.moGlowRad.get()))); + 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 17b56e8e4f91..aebd6901c864 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3635,7 +3635,7 @@ void DrawingML::WriteShapeEffect( const OUString& sName, const Sequence< Propert } else if( rOuterShdwProp.Name == "rad" ) { - sal_Int32 nVal = 0; + sal_Int64 nVal = 0; rOuterShdwProp.Value >>= nVal; aOuterShdwAttrList->add( XML_rad, OString::number( nVal ).getStr() ); } @@ -3846,9 +3846,11 @@ void DrawingML::WriteGlowEffect(const Reference< XPropertySet >& rXPropSet) if(!hasGlow) return; + sal_Int32 nRad = 0; + rXPropSet->getPropertyValue("GlowEffectRad") >>= nRad; Sequence< PropertyValue > aGlowAttribs(1); aGlowAttribs[0].Name = "rad"; - aGlowAttribs[0].Value = rXPropSet->getPropertyValue("GlowEffectRad"); + aGlowAttribs[0].Value <<= oox::drawingml::convertHmmToEmu(nRad); Sequence< PropertyValue > aGlowProps(3); aGlowProps[0].Name = "Attribs"; aGlowProps[0].Value <<= aGlowAttribs; -- cgit