oox/source/export/shapes.cxx |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 9ae9bb6e224b6bd03c155825ed4f5742c231cc72
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Apr 5 20:03:06 2023 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Apr 6 11:32:50 2023 +0200

    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 <caol...@redhat.com>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit aa1008e29bcfbee2397f72971d2de745fad8e98a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150076

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 4ef05ba80cab..199180862c69 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())

Reply via email to