diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-04-05 20:03:06 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-05-13 20:01:48 +0200 |
commit | a9289bf19ffec421338320e1bb1532389ea0c2dd (patch) | |
tree | 493f66faa44ecd552fb9ef333460808cd6f924f6 /oox | |
parent | 04fc164ca57533db00e1e7da991d6e665c8311f2 (diff) |
oox: fix crash in lcl_GetGluePointId by removing unused code
See
https://crashreport.libreoffice.org/stats/signature/oox::drawingml::lcl_GetGluePointId
Change-Id: I7737568b12a18a2195f24f023917d30dd838ea12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150064
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit aa1008e29bcfbee2397f72971d2de745fad8e98a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150076
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/shapes.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index bec056d90e84..b543dcea82c6 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1650,20 +1650,17 @@ static void lcl_GetConnectorAdjustValue(const Reference<XShape>& xShape, tools:: } } -static sal_Int32 lcl_GetGluePointId(const Reference<XShape>& xShape, sal_Int32& nGluePointId) +static sal_Int32 lcl_GetGluePointId(sal_Int32 nGluePointId) { - uno::Reference<drawing::XGluePointsSupplier> xSupplier(xShape, uno::UNO_QUERY); - uno::Reference<container::XIdentifierAccess> xGluePoints(xSupplier->getGluePoints(), - uno::UNO_QUERY); if (nGluePointId > 3) - nGluePointId -= 4; + return nGluePointId - 4; else { // change id of the bounding box (1 <-> 3) if (nGluePointId == 1) - nGluePointId = 3; // Right + return 3; // Right else if (nGluePointId == 3) - nGluePointId = 1; // Left + return 1; // Left } return nGluePointId; @@ -1717,10 +1714,10 @@ ShapeExport& ShapeExport::WriteConnectorShape( const Reference< XShape >& xShape GET(nStartGlueId, StartGluePointIndex); if (nStartGlueId != -1) - lcl_GetGluePointId(rXShapeA, nStartGlueId); + nStartGlueId = lcl_GetGluePointId(nStartGlueId); GET(nEndGlueId, EndGluePointIndex); if (nEndGlueId != -1) - lcl_GetGluePointId(rXShapeB, nEndGlueId); + nEndGlueId = lcl_GetGluePointId(nEndGlueId); // Position is relative to group in Word, but relative to anchor of group in API. if (GetDocumentType() == DOCUMENT_DOCX && !mbUserShapes && m_xParent.is()) |