summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/effectproperties.cxx
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-04-14 15:49:28 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-05-12 09:56:10 +0200
commit7e54295440438b608cb12d5f62896839ca070fab (patch)
tree50fbb27fd2363fc1b4da8a2c2f3e8c5d684c6e2d /oox/source/drawingml/effectproperties.cxx
parent42a4789a5acb260b819d51b1bd87747b81453b74 (diff)
tdf#130058 Import shadow size.
Change-Id: Ie1cee377a33567088fb76ea47f0e6fc51d47f0fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92188 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93419 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox/source/drawingml/effectproperties.cxx')
-rw-r--r--oox/source/drawingml/effectproperties.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx
index bbfee474b3f2..d1f07964b09e 100644
--- a/oox/source/drawingml/effectproperties.cxx
+++ b/oox/source/drawingml/effectproperties.cxx
@@ -23,6 +23,8 @@ void EffectShadowProperties::assignUsed(const EffectShadowProperties& rSourcePro
{
moShadowDist.assignIfUsed( rSourceProps.moShadowDist );
moShadowDir.assignIfUsed( rSourceProps.moShadowDir );
+ moShadowSx.assignIfUsed( rSourceProps.moShadowSx );
+ moShadowSy.assignIfUsed( rSourceProps.moShadowSy );
moShadowColor.assignIfUsed( rSourceProps.moShadowColor );
}
@@ -48,6 +50,9 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
if( it->msName == "outerShdw" )
{
sal_Int32 nAttrDir = 0, nAttrDist = 0;
+ sal_Int32 nAttrSizeX = 100000, nAttrSizeY = 100000; // If shadow size is %100=100000 (means equal to object's size), sx sy is not exists,
+ // Default values of sx, sy should be 100000 in this case.
+
std::map< OUString, css::uno::Any >::const_iterator attribIt = it->maAttribs.find( "dir" );
if( attribIt != it->maAttribs.end() )
attribIt->second >>= nAttrDir;
@@ -56,6 +61,15 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
if( attribIt != it->maAttribs.end() )
attribIt->second >>= nAttrDist;
+ attribIt = it->maAttribs.find( "sx" );
+ if( attribIt != it->maAttribs.end() )
+ attribIt->second >>= nAttrSizeX;
+
+ attribIt = it->maAttribs.find( "sy" );
+ if( attribIt != it->maAttribs.end() )
+ attribIt->second >>= nAttrSizeY;
+
+ // Negative X or Y dist indicates left or up, respectively
// Negative X or Y dist indicates left or up, respectively
double nAngle = basegfx::deg2rad(static_cast<double>(nAttrDir) / PER_DEGREE);
sal_Int32 nDist = convertEmuToHmm( nAttrDist );
@@ -65,6 +79,8 @@ void EffectProperties::pushToPropMap( PropertyMap& rPropMap,
rPropMap.setProperty( PROP_Shadow, true );
rPropMap.setProperty( PROP_ShadowXDistance, nXDist);
rPropMap.setProperty( PROP_ShadowYDistance, nYDist);
+ rPropMap.setProperty( PROP_ShadowSizeX, nAttrSizeX);
+ rPropMap.setProperty( PROP_ShadowSizeY, nAttrSizeY);
rPropMap.setProperty( PROP_ShadowColor, it->moColor.getColor(rGraphicHelper ) );
rPropMap.setProperty( PROP_ShadowTransparence, it->moColor.getTransparency());
}