Kaydet (Commit) b0176f62 authored tarafından Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer Kaydeden (comit) Petr Mladek

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/775Reviewed-by: 's avatarPetr Mladek <pmladek@suse.cz>
Tested-by: 's avatarPetr Mladek <pmladek@suse.cz>
üst e6b28a09
...@@ -463,7 +463,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes ...@@ -463,7 +463,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
if ( maTypeModel.maWidthRelative.isEmpty() || maTypeModel.maWidthRelative == "page" ) if ( maTypeModel.maWidthRelative.isEmpty() || maTypeModel.maWidthRelative == "page" )
{ {
sal_Int16 nWidth = maTypeModel.maWidthPercent.toInt32() / 10; 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( ) ) if ( !maTypeModel.maHeightPercent.isEmpty( ) )
...@@ -472,7 +474,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes ...@@ -472,7 +474,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
if ( maTypeModel.maHeightRelative.isEmpty() || maTypeModel.maHeightRelative == "page" ) if ( maTypeModel.maHeightRelative.isEmpty() || maTypeModel.maHeightRelative == "page" )
{ {
sal_Int16 nHeight = maTypeModel.maHeightPercent.toInt32() / 10; 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 ) );
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment