diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index b4e7b137b182..f7e84db57784 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -713,9 +713,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) pFS->startElementNS( mnXmlNamespace, XML_spPr, FSEND ); // moon is flipped in MSO, and mso-spt89 (right up arrow) is mapped to leftUpArrow if ( sShapeType == "moon" || sShapeType == "mso-spt89" ) - WriteShapeTransformation( xShape, XML_a, !bFlipH, bFlipV ); - else - WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); + bFlipH = !bFlipH; // we export non-primitive shapes to custom geometry // we also export non-ooxml shapes which have handles/equations to custom geometry, because @@ -736,14 +734,26 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape ) if (bHasHandles && bCustGeom && pShape) { - WritePolyPolygon( tools::PolyPolygon( pShape->GetLineGeometry(true) ) ); + WriteShapeTransformation( xShape, XML_a ); // do not flip, polypolygon coordinates are flipped already + tools::PolyPolygon aPolyPolygon( pShape->GetLineGeometry(true) ); + sal_Int32 nRotation = 0; + // The RotateAngle property's value is independent from any flipping, and that's exactly what we need here. + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo(); + if (xPropertySetInfo->hasPropertyByName("RotateAngle")) + xPropertySet->getPropertyValue("RotateAngle") >>= nRotation; + if (nRotation != 0) + aPolyPolygon.Rotate(Point(0,0), static_cast<sal_uInt16>(3600-nRotation/10)); + WritePolyPolygon( aPolyPolygon ); } else if (bCustGeom) { + WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); WriteCustomGeometry( xShape ); } else // preset geometry { + WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); if( nAdjustmentValuesIndex != -1 ) { sal_Int32 nAdjustmentsWhichNeedsToBeConverted = 0; |