sd/source/ui/unoidl/unomodel.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 980e9c52b83c6546718c67a6078076a6603ed9f1
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Wed Sep 11 00:05:29 2024 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Sep 11 11:05:23 2024 +0200

    lok: getSlideShowInfo: interactions: check that properties are available
    
    Not all properties are available for all kind of shapes.
    In this case Visible is not available for a SvxFrameShape.
    
    Change-Id: I7811ab6cd04d782f8758fbee449bbc5bc421fd51
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173150
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index b6617ff17039..2fdf3ec3ab4b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -4219,10 +4219,17 @@ void getShapeClickAction(const 
uno::Reference<drawing::XShape> &xShape, ::tools:
     uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
     if (!xShapeProps)
         return;
+
+    if (!xShapeProps->getPropertySetInfo()->hasPropertyByName( u"Visible"_ustr 
))
+        return;
     xShapeProps->getPropertyValue("Visible") >>= bIsShapeVisible;
+
     if (!bIsShapeVisible)
         return;
 
+    if (!xShapeProps->getPropertySetInfo()->hasPropertyByName( u"OnClick"_ustr 
))
+        return;
+
     presentation::ClickAction eClickAction = presentation::ClickAction_NONE;
     xShapeProps->getPropertyValue(u"OnClick"_ustr) >>= eClickAction;
 
@@ -4233,7 +4240,9 @@ void getShapeClickAction(const 
uno::Reference<drawing::XShape> &xShape, ::tools:
         sal_Int32 nVerb = 0;
         OUString sBookmark;
 
-        xShapeProps->getPropertyValue(u"Bookmark"_ustr) >>= sBookmark;
+        if (xShapeProps->getPropertySetInfo()->hasPropertyByName( 
u"Bookmark"_ustr ))
+            xShapeProps->getPropertyValue(u"Bookmark"_ustr) >>= sBookmark;
+
         {
             auto* pObject = SdrObject::getSdrObjectFromXShape(xShape);
             auto const& rRectangle = pObject->GetLogicRect();

Reply via email to