diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 37 | ||||
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 15 |
2 files changed, 39 insertions, 13 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 971d112a6402..6e839f32e9c5 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1640,17 +1640,38 @@ static void lcl_GetConnectorAdjustValue(const Reference<XShape>& xShape, tools:: } } -static sal_Int32 lcl_GetGluePointId(sal_Int32 nGluePointId) +static sal_Int32 lcl_GetGluePointId(const Reference<XShape>& xShape, sal_Int32 nGluePointId) { if (nGluePointId > 3) return nGluePointId - 4; else { - // change id of the bounding box (1 <-> 3) - if (nGluePointId == 1) - return 3; // Right - else if (nGluePointId == 3) - return 1; // Left + bool bFlipH = false; + bool bFlipV = false; + Reference<XPropertySet> xShapeProps(xShape, UNO_QUERY); + if (xShapeProps->getPropertySetInfo()->hasPropertyByName("CustomShapeGeometry")) + { + Sequence<PropertyValue> aGeometrySeq; + xShapeProps->getPropertyValue("CustomShapeGeometry") >>= aGeometrySeq; + for (int i = 0; i < aGeometrySeq.getLength(); i++) + { + const PropertyValue& rProp = aGeometrySeq[i]; + if (rProp.Name == "MirroredX") + rProp.Value >>= bFlipH; + + if (rProp.Name == "MirroredY") + rProp.Value >>= bFlipV; + } + } + + if ((!bFlipH && !bFlipV) || (bFlipH && bFlipV)) + { + // change id of the bounding box (1 <-> 3) + if (nGluePointId == 1) + nGluePointId = 3; // Right + else if (nGluePointId == 3) + nGluePointId = 1; // Left + } } return nGluePointId; @@ -1708,12 +1729,12 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape if (GetProperty(rXPropSet, "StartGluePointIndex")) mAny >>= nStartGlueId; if (nStartGlueId != -1) - nStartGlueId = lcl_GetGluePointId(nStartGlueId); + nStartGlueId = lcl_GetGluePointId(rXShapeA, nStartGlueId); if (GetProperty(rXPropSet, "EndGluePointIndex")) mAny >>= nEndGlueId; if (nEndGlueId != -1) - nEndGlueId = lcl_GetGluePointId(nEndGlueId); + nEndGlueId = lcl_GetGluePointId(rXShapeB, nEndGlueId); // Position is relative to group in Word, but relative to anchor of group in API. if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is()) diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 7298eea1247c..349262fc6b8f 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -654,11 +654,16 @@ void SlidePersist::createConnectorShapeConnection() nGlueId += 4; else { - // change id of the left and right glue points of the bounding box (1 <-> 3) - if (nGlueId == 1) - nGlueId = 3; // Right - else if (nGlueId == 3) - nGlueId = 1; // Left + bool bFlipH = pShape->second->getFlipH(); + bool bFlipV = pShape->second->getFlipV(); + if ((!bFlipH && !bFlipV) || (bFlipH && bFlipV)) + { + // change id of the left and right glue points of the bounding box (1 <-> 3) + if (nGlueId == 1) + nGlueId = 3; // Right + else if (nGlueId == 3) + nGlueId = 1; // Left + } } bool bStart = aConnectorShapeProperties[j].mbStartShape; |