diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-12 15:51:45 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-12 16:08:19 +0200 |
commit | 144ca12ef3e17e1d315a496b456cd2bb4cd08744 (patch) | |
tree | ed0801611ce129853bd55321b577d9a4b18e30bb /oox | |
parent | 9ffd693d6ee326df5d35859f90f08f4f34069dbf (diff) |
VML import: handle rotation on groupshapes
Change-Id: I37f0081ae0a8af838c9f5bf158b340d726d7d1a3
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 405c6686457f..e1df8e6ac520 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -490,6 +490,13 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) lcl_setSurround( rPropSet, rTypeModel ); } +void lcl_SetRotation(PropertySet& rPropSet, const sal_Int32 nRotation) +{ + // See DffPropertyReader::Fix16ToAngle(): in VML, positive rotation angles are clockwise, we have them as counter-clockwise. + // Additionally, VML type is 0..360, our is 0.36000. + rPropSet.setAnyProperty(PROP_RotateAngle, makeAny(sal_Int32(NormAngle360(nRotation * -100)))); +} + Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const awt::Rectangle& rShapeRect ) const { awt::Rectangle aShapeRect(rShapeRect); @@ -580,9 +587,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes PropertySet aPropertySet(xShape); if (xShape.is() && oRotation) { - // See DffPropertyReader::Fix16ToAngle(): in VML, positive rotation angles are clockwise, we have them as counter-clockwise. - // Additionally, VML type is 0..360, our is 0.36000. - aPropertySet.setAnyProperty(PROP_RotateAngle, makeAny(sal_Int32(NormAngle360((*oRotation) * -100)))); + lcl_SetRotation(aPropertySet, *oRotation); // If rotation is used, simple setPosition() is not enough. aPropertySet.setAnyProperty(PROP_HoriOrientPosition, makeAny( aShapeRect.X ) ); aPropertySet.setAnyProperty(PROP_VertOrientPosition, makeAny( aShapeRect.Y ) ); @@ -984,6 +989,8 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes > // Make sure group shapes are inline as well, unless there is an explicit different style. PropertySet aPropertySet(xGroupShape); lcl_SetAnchorType(aPropertySet, maTypeModel); + if (!maTypeModel.maRotation.isEmpty()) + lcl_SetRotation(aPropertySet, maTypeModel.maRotation.toInt32()); return xGroupShape; } |