diff options
author | Pierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com> | 2012-10-05 15:30:11 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-13 18:20:58 +0100 |
commit | 04b32936c55c1fe543f86ac077d75dda7e2fb49b (patch) | |
tree | c496d0359d701e2b26e0bb4d5ee870fff331759e | |
parent | b3dadcc1f542d406f8cb8c59c57ae34b2de9fe22 (diff) |
vml import: only apply width-percent attribute if it's != 0
This fixes an issue with a shape defined with these attributes:
mso-width-percent:0;mso-height-percent:0 and
mso-width-relative:page;mso-height-relative:page;
where all points were then located in (0,0)
Change-Id: I51070ad2b2e4e05ab64f16813472ca1d7099fb09
Reviewed-on: https://gerrit.libreoffice.org/775
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 1e9573e44c36..fde972cd907d 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -464,7 +464,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes if ( maTypeModel.maWidthRelative.isEmpty() || maTypeModel.maWidthRelative.equalsAscii( "page" ) ) { sal_Int16 nWidth = maTypeModel.maWidthPercent.toInt32() / 10; - PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) ); + // Only apply if nWidth != 0 + if ( nWidth ) + PropertySet( xShape ).setAnyProperty(PROP_RelativeWidth, makeAny( nWidth ) ); } } if ( !maTypeModel.maHeightPercent.isEmpty( ) ) @@ -473,7 +475,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes if ( maTypeModel.maHeightRelative.isEmpty() || maTypeModel.maHeightRelative.equalsAscii( "page" ) ) { sal_Int16 nHeight = maTypeModel.maHeightPercent.toInt32() / 10; - PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) ); + // Only apply if nHeight != 0 + if ( nHeight ) + PropertySet( xShape ).setAnyProperty(PROP_RelativeHeight, makeAny( nHeight ) ); } } } |