diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-04-14 15:49:28 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-05-12 09:56:10 +0200 |
commit | 7e54295440438b608cb12d5f62896839ca070fab (patch) | |
tree | 50fbb27fd2363fc1b4da8a2c2f3e8c5d684c6e2d /oox | |
parent | 42a4789a5acb260b819d51b1bd87747b81453b74 (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')
-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 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()); } diff --git a/oox/source/drawingml/effectproperties.hxx b/oox/source/drawingml/effectproperties.hxx index 146214cc9191..092ca62669ae 100644 --- a/oox/source/drawingml/effectproperties.hxx +++ b/oox/source/drawingml/effectproperties.hxx @@ -24,6 +24,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 4c779e75f1ef..40c132f3fb2c 100644 --- a/oox/source/drawingml/effectpropertiescontext.cxx +++ b/oox/source/drawingml/effectpropertiescontext.cxx @@ -83,6 +83,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 c6168be243ab..7a37c0641a93 100644 --- a/oox/source/drawingml/shapepropertymap.cxx +++ b/oox/source/drawingml/shapepropertymap.cxx @@ -49,7 +49,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 2a9295367c11..b4ee4ba0f9c4 100644 --- a/oox/source/token/properties.txt +++ b/oox/source/token/properties.txt @@ -444,6 +444,8 @@ SelectedPage Shadow ShadowColor ShadowFormat +ShadowSizeX +ShadowSizeY ShadowTransparence ShadowXDistance ShadowYDistance |