summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-08-16 18:28:26 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-16 19:53:31 +0200
commiteeae7bf241ce34ac5b946a6b55a53c3f3a1c3d12 (patch)
tree3818fc18fd9d06046d3a69b3c82ef5efdae5eeee /oox
parent682dff097be62a325945c5edd7b81f076a8ef106 (diff)
VML import of mso-wrap-distance-{left,right,top,bottom}
Change-Id: Ib16be0bf83120ed7aeb01f29634d51421fc351c8
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlshape.cxx19
-rw-r--r--oox/source/vml/vmlshapecontext.cxx4
2 files changed, 23 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 0c88d3fa372c..47d8ceb65727 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -522,6 +522,25 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, aShapeRect );
convertShapeProperties( xShape );
+ // Handle left/right/top/bottom wrap distance.
+ const GraphicHelper& rGraphicHelper = mrDrawing.getFilter().getGraphicHelper();
+ sal_Int32 nWrapDistanceLeft = 0;
+ if (!maTypeModel.maWrapDistanceLeft.isEmpty())
+ nWrapDistanceLeft = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceLeft, 0, true, true);
+ PropertySet(xShape).setAnyProperty(PROP_LeftMargin, uno::makeAny(nWrapDistanceLeft));
+ sal_Int32 nWrapDistanceRight = 0;
+ if (!maTypeModel.maWrapDistanceRight.isEmpty())
+ nWrapDistanceRight = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceRight, 0, true, true);
+ PropertySet(xShape).setAnyProperty(PROP_RightMargin, uno::makeAny(nWrapDistanceRight));
+ sal_Int32 nWrapDistanceTop = 0;
+ if (!maTypeModel.maWrapDistanceTop.isEmpty())
+ nWrapDistanceTop = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceTop, 0, false, true);
+ PropertySet(xShape).setAnyProperty(PROP_TopMargin, uno::makeAny(nWrapDistanceTop));
+ sal_Int32 nWrapDistanceBottom = 0;
+ if (!maTypeModel.maWrapDistanceBottom.isEmpty())
+ nWrapDistanceBottom = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceBottom, 0, false, true);
+ PropertySet(xShape).setAnyProperty(PROP_BottomMargin, uno::makeAny(nWrapDistanceBottom));
+
if ( maService.equalsAscii( "com.sun.star.text.TextFrame" ) )
{
PropertySet( xShape ).setAnyProperty( PROP_FrameIsAutomaticHeight, makeAny( maTypeModel.mbAutoHeight ) );
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 3c47c668cd39..48340d55c8f1 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -418,6 +418,10 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
mrTypeModel.mbVisible = !aValue.equalsAscii( "hidden" );
else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue;
else if ( aName == "v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue;
+ else if ( aName == "mso-wrap-distance-left" ) mrTypeModel.maWrapDistanceLeft = aValue;
+ else if ( aName == "mso-wrap-distance-right" ) mrTypeModel.maWrapDistanceRight = aValue;
+ else if ( aName == "mso-wrap-distance-top" ) mrTypeModel.maWrapDistanceTop = aValue;
+ else if ( aName == "mso-wrap-distance-bottom" ) mrTypeModel.maWrapDistanceBottom = aValue;
}
}
}