diff options
author | Paul Trojahn <paul.trojahn@gmail.com> | 2017-11-30 15:17:04 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-12-08 03:37:33 +0100 |
commit | baa205c001540b5dbc795cd876e661549d432ac1 (patch) | |
tree | c4ee9bc1d3d24cbcf7985efafc357371cfac5c81 /oox | |
parent | 12b389e838743dec662c70c4772553a96ad4f9ac (diff) |
tdf#68759 PPTX: Export IsMirrored
Change-Id: I6bab00f79f1cb122344e4bb9fd62eb4c48a1838b
Reviewed-on: https://gerrit.libreoffice.org/45808
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 12 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 7 |
2 files changed, 13 insertions, 6 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index d243a4f99d13..1ec05fa2a2e9 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1286,7 +1286,7 @@ void DrawingML::WriteTransformation(const tools::Rectangle& rRect, mpFS->endElementNS( nXmlNamespace, XML_xfrm ); } -void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH, bool bFlipV, bool bSuppressRotation, bool bSuppressFlipping ) +void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sal_Int32 nXmlNamespace, bool bFlipH, bool bFlipV, bool bSuppressRotation, bool bSuppressFlipping, bool bFlippedBeforeRotation ) { SAL_INFO("oox.shape", "write shape transformation"); @@ -1294,6 +1294,11 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa awt::Point aPos = rXShape->getPosition(); awt::Size aSize = rXShape->getSize(); + bool bFlipHWrite = bFlipH && !bSuppressFlipping; + bool bFlipVWrite = bFlipV && !bSuppressFlipping; + bFlipH = bFlipH && !bFlippedBeforeRotation; + bFlipV = bFlipV && !bFlippedBeforeRotation; + bool bPositiveY = true; bool bPositiveX = true; @@ -1345,14 +1350,11 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa if(bFlipH != bFlipV) nRotation = nRotation * -1 + 36000; - if(bSuppressFlipping) - bFlipH = bFlipV = false; - uno::Reference<lang::XServiceInfo> xServiceInfo(rXShape, uno::UNO_QUERY_THROW); bool bIsGroupShape = (xServiceInfo.is() && xServiceInfo->supportsService("com.sun.star.drawing.GroupShape")); WriteTransformation(tools::Rectangle(Point(aPos.X, aPos.Y), Size(aSize.Width, aSize.Height)), nXmlNamespace, - bFlipH, bFlipV, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), bIsGroupShape); + bFlipHWrite, bFlipVWrite, OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(nRotation), bIsGroupShape); } void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool bIsField, sal_Int32 nElement, bool bCheckDirect, diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index a80809c663e2..b2a07a2f4ca4 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1186,7 +1186,12 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape // visual shape properties pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND ); - WriteShapeTransformation( xShape, XML_a ); + bool bFlipH = false; + if( xShapeProps->getPropertySetInfo()->hasPropertyByName("IsMirrored") ) + { + xShapeProps->getPropertyValue("IsMirrored") >>= bFlipH; + } + WriteShapeTransformation( xShape, XML_a, bFlipH, false, false, false, true ); WritePresetShape( "rect" ); // graphic object can come with the frame (bnc#654525) WriteOutline( xShapeProps ); |