diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-01-06 09:42:20 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-01-06 15:19:35 +0000 |
commit | 86847b02c581e908b5aae1cb13be7dba0e40e180 (patch) | |
tree | ca3c6d69b249561e4635ce441a55148c39f7a796 /oox | |
parent | ed11f8eb344fb70d17a76f15365f181a662bcc98 (diff) |
tdf#105127 VML import: handle <v:shape style="flip:..." path="...">
I don't see an easy way to implement this via UNO, so use the internal
API. As to the internal API usage,
SdrEditView::MirrorMarkedObjVertical() (for UI) and
SvxMSDffManager::ImportShape() (for WW8 import) are example client code.
Change-Id: I9bf27788db32fd35d6b56e0f1a240c4b7abc5604
(cherry picked from commit ac03883cd66a2d58c17c8dac555a053586e46625)
Reviewed-on: https://gerrit.libreoffice.org/32778
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index c978c3970480..0b68675ae72e 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -1058,6 +1058,28 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes aPropSet.setProperty( PROP_PolyPolygonBezier, aBezierCoords ); } + // Handle horizontal and vertical flip. + if (!maTypeModel.maFlip.isEmpty()) + { + if (SdrObject* pShape = GetSdrObjectFromXShape(xShape)) + { + if (maTypeModel.maFlip.startsWith("x")) + { + Point aCenter(pShape->GetSnapRect().Center()); + Point aPoint2(aCenter); + aPoint2.setY(aPoint2.getY() + 1); + pShape->NbcMirror(aCenter, aPoint2); + } + if (maTypeModel.maFlip.endsWith("y")) + { + Point aCenter(pShape->GetSnapRect().Center()); + Point aPoint2(aCenter); + aPoint2.setX(aPoint2.getX() + 1); + pShape->NbcMirror(aCenter, aPoint2); + } + } + } + // Hacky way of ensuring the shape is correctly sized/positioned xShape->setSize( awt::Size( rShapeRect.Width, rShapeRect.Height ) ); xShape->setPosition( awt::Point( rShapeRect.X, rShapeRect.Y ) ); |