[Libreoffice-commits] core.git: xmloff/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 22 11:07:34 UTC 2021


 xmloff/source/draw/shapeexport.cxx |   31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

New commits:
commit c5d984b840db595796051bc2bf37d1c2179157e3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 22 09:42:58 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 22 13:06:49 2021 +0200

    crashtesting: assert on export of tdf105134-1.docx to odt
    
    when interactively saving on creating preview for recently used
    
    Change-Id: I9d859cf404c34659653a14f8c2a94f867c704b7e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117616
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index e68bf388325f..5ed81e82a247 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2129,23 +2129,26 @@ void XMLShapeExport::ImpExportLineShape(
     // create base position
     awt::Point aBasePosition(FRound(aTRTranslate.getX()), FRound(aTRTranslate.getY()));
 
-    // get the two points
-    uno::Any aAny(xPropSet->getPropertyValue("Geometry"));
-    if (auto pSourcePolyPolygon
-            = o3tl::tryAccess<drawing::PointSequenceSequence>(aAny))
+    if (xPropSet->getPropertySetInfo()->hasPropertyByName("Geometry"))
     {
-        if (pSourcePolyPolygon->getLength() > 0)
+        // get the two points
+        uno::Any aAny(xPropSet->getPropertyValue("Geometry"));
+        if (auto pSourcePolyPolygon
+                = o3tl::tryAccess<drawing::PointSequenceSequence>(aAny))
         {
-            const drawing::PointSequence& rInnerSequence = (*pSourcePolyPolygon)[0];
-            if (rInnerSequence.hasElements())
+            if (pSourcePolyPolygon->getLength() > 0)
             {
-                const awt::Point& rPoint = rInnerSequence[0];
-                aStart = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y);
-            }
-            if (rInnerSequence.getLength() > 1)
-            {
-                const awt::Point& rPoint = rInnerSequence[1];
-                aEnd = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y);
+                const drawing::PointSequence& rInnerSequence = (*pSourcePolyPolygon)[0];
+                if (rInnerSequence.hasElements())
+                {
+                    const awt::Point& rPoint = rInnerSequence[0];
+                    aStart = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y);
+                }
+                if (rInnerSequence.getLength() > 1)
+                {
+                    const awt::Point& rPoint = rInnerSequence[1];
+                    aEnd = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y);
+                }
             }
         }
     }


More information about the Libreoffice-commits mailing list