sd/source/ui/unoidl/unomodel.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
New commits: commit 75a241e7c70df69525a777e0ecdef17b38aec974 Author: Marco Cecchetti <marco.cecche...@collabora.com> AuthorDate: Wed Sep 11 00:05:29 2024 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Thu Nov 28 13:17:14 2024 +0100 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/+/177470 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 5023b41a1996..436a0c91211a 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -4253,10 +4253,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; @@ -4267,7 +4274,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();