summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com>2012-10-05 15:30:11 +0200
committerAndras Timar <atimar@suse.com>2013-01-13 21:59:44 +0100
commit7108705874a3f445744c197ce5ee0412a3fe3977 (patch)
tree78f2b1532552bbae8875b4d561b6bfd7717eb674
parent71c485a99640b366aa511b0b27f4b0207f2b1db5 (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.cxx8
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 ) );
}
}
}