summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-03-27 18:39:04 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-03-28 10:28:51 +0200
commit4159a4e6ce38b333ced3ba5f75e28473605633e8 (patch)
tree181c031c38116f179deb2ad15740d0b8382f1573
parent559ecabbfc6d78df995c899ba996a470e241b76c (diff)
n#751117 oox: implement VML import of shape style 'flip'
-rw-r--r--oox/inc/oox/vml/vmlshape.hxx1
-rw-r--r--oox/source/vml/vmlshape.cxx17
-rw-r--r--oox/source/vml/vmlshapecontext.cxx1
3 files changed, 18 insertions, 1 deletions
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index bde882374e49..c4ab2cd6f814 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -81,6 +81,7 @@ struct ShapeTypeModel
::rtl::OUString maMarginTop; ///< Y position of the shape bounding box to shape anchor (number with unit).
::rtl::OUString maPositionVerticalRelative; ///< The Y position is relative to this.
::rtl::OUString maRotation; ///< Rotation of the shape, in degrees.
+ ::rtl::OUString maFlip; ///< Rotation of the shape, in degrees.
sal_Bool mbAutoHeight; ///< If true, the height value is a minimum value (mostly used for textboxes)
StrokeModel maStrokeModel; ///< Border line formatting.
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index ad508c68ad96..37e64313d7ba 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -367,7 +367,22 @@ SimpleShape::SimpleShape( Drawing& rDrawing, const OUString& rService ) :
Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes >& rxShapes, const Rectangle& rShapeRect ) const
{
- Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, rShapeRect );
+ Rectangle aShapeRect(rShapeRect);
+ if (!maTypeModel.maFlip.isEmpty())
+ {
+ if (maTypeModel.maFlip.equalsAscii("x"))
+ {
+ aShapeRect.X += aShapeRect.Width;
+ aShapeRect.Width *= -1;
+ }
+ else if (maTypeModel.maFlip.equalsAscii("y"))
+ {
+ aShapeRect.Y += aShapeRect.Height;
+ aShapeRect.Height *= -1;
+ }
+ }
+
+ Reference< XShape > xShape = mrDrawing.createAndInsertXShape( maService, rxShapes, aShapeRect );
convertShapeProperties( xShape );
if ( maService.equalsAscii( "com.sun.star.text.TextFrame" ) )
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index fb10331e8362..57a85e90f161 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -350,6 +350,7 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-position-vertical-relative" ) ) ) mrTypeModel.maPositionVerticalRelative = aValue;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-fit-shape-to-text" ) ) ) mrTypeModel.mbAutoHeight = sal_True;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "rotation" ) ) ) mrTypeModel.maRotation = aValue;
+ else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "flip" ) ) ) mrTypeModel.maFlip = aValue;
}
}
}