diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-04-14 15:49:28 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2020-04-23 10:07:13 +0200 |
commit | 6454b6336b8de9a4c5899adeab552af6f794cdc4 (patch) | |
tree | efe9ea2e9b0131c4e9143cb1a085586de6f6e91a /oox | |
parent | 0e75f025419f878dc772391cea8d55765bceb9fc (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>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/drawingml/effectproperties.cxx | 16 | ||||
-rw-r--r-- | oox/source/drawingml/effectproperties.hxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/effectpropertiescontext.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/shapepropertymap.cxx | 4 | ||||
-rw-r--r-- | oox/source/token/properties.txt | 2 |
5 files changed, 25 insertions, 1 deletions
diff --git a/oox/source/drawingml/effectproperties.cxx b/oox/source/drawingml/effectproperties.cxx index a090f700a734..dd5fdd0693f9 100644 --- a/oox/source/drawingml/effectproperties.cxx +++ b/oox/source/drawingml/effectproperties.cxx @@ -26,6 +26,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 ); } @@ -52,6 +54,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; @@ -60,6 +65,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 ); @@ -69,6 +83,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()); } diff --git a/oox/source/drawingml/effectproperties.hxx b/oox/source/drawingml/effectproperties.hxx index c4f39ac8803b..e1e42d485789 100644 --- a/oox/source/drawingml/effectproperties.hxx +++ b/oox/source/drawingml/effectproperties.hxx @@ -33,6 +33,8 @@ struct EffectShadowProperties { OptValue< sal_Int64 > moShadowDist; OptValue< sal_Int64 > moShadowDir; + OptValue< sal_Int64 > moShadowSx; + OptValue< sal_Int64 > moShadowSy; Color moShadowColor; /** Overwrites all members that are explicitly set in rSourceProps. */ diff --git a/oox/source/drawingml/effectpropertiescontext.cxx b/oox/source/drawingml/effectpropertiescontext.cxx index 982fa9f00bd3..28fdd8ea4fcf 100644 --- a/oox/source/drawingml/effectpropertiescontext.cxx +++ b/oox/source/drawingml/effectpropertiescontext.cxx @@ -82,6 +82,8 @@ ContextHandlerRef EffectPropertiesContext::onCreateContext( sal_Int32 nElement, mrEffectProperties.maShadow.moShadowDist = rAttribs.getInteger( XML_dist, 0 ); mrEffectProperties.maShadow.moShadowDir = rAttribs.getInteger( XML_dir, 0 ); + mrEffectProperties.maShadow.moShadowSx = rAttribs.getInteger( XML_sx, 0 ); + mrEffectProperties.maShadow.moShadowSy = rAttribs.getInteger( XML_sy, 0 ); return new ColorContext(*this, mrEffectProperties.m_Effects[nPos]->moColor); } break; diff --git a/oox/source/drawingml/shapepropertymap.cxx b/oox/source/drawingml/shapepropertymap.cxx index 8a5a8e704711..6542f877f4f0 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -48,7 +48,9 @@ static const ShapePropertyIds spnDefaultShapeIds = PROP_FillHatch, PROP_FillBackground, PROP_FillBitmapName, - PROP_ShadowXDistance + PROP_ShadowXDistance, + PROP_ShadowSizeX, + PROP_ShadowSizeY }; } // namespace diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt index 83dd8f9ff3d1..5c507fab553d 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -449,6 +449,8 @@ SelectedPage Shadow ShadowColor ShadowFormat +ShadowSizeX +ShadowSizeY ShadowTransparence ShadowXDistance ShadowYDistance |