From aafab1213bf90e24783f237581fe41fadb861f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 27 Jul 2026 16:49:47 +0000 Subject: [PATCH] Resolves: tdf#172918 allow a media link the user inserts in this session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The document-wide link update permission is decided when the document is loaded. But media files that the users interactively inserts should be automatically allowed. Remember on the media object that the user picked the reference and allow it on its own, the same way a presentation sound the user picks is allowed. A reference that arrived with the document still needs the document-wide permission. since: commit f0768394c14f928d47547408fc1195368be81f86 Date: Tue Jul 14 19:12:01 2026 +0100 put slideshow media links under link control see also: commit 0aa870b7b5a6bda50bab50c7a0a41d28fdf4f6ab Date: Wed Jun 17 09:37:23 2026 +0000 bring external presentation sounds under link management Signed-off-by: Caolán McNamara Reviewed-on: https://gerrit.collaboraoffice.com/c/core/+/7939 Tested-by: Jenkins CPCI Reviewed-by: Michael Stahl (cherry picked from commit 17c0a99a0886b397d5682b87209e34c01fdcd44f) Change-Id: I711fee12416e3e5e91fc07999ea62df32684b625 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211276 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- slideshow/source/engine/shapes/viewmediashape.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index fb4d833b4d9e..c40e848d60d5 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -271,16 +270,9 @@ namespace slideshow::internal bool ViewMediaShape::implMediaLinkAllowed() const { - SdrObject* pObj = SdrObject::getSdrObjectFromXShape(mxShape); - if (!pObj) - return false; - uno::Reference xModelProps( - pObj->getSdrModelFromSdrObject().getUnoModel(), uno::UNO_QUERY); - if (!xModelProps.is()) - return false; - bool bAllow = false; - xModelProps->getPropertyValue(u"AllowLinkUpdate"_ustr) >>= bAllow; - return bAllow; + SdrMediaObj* pObj + = dynamic_cast(SdrObject::getSdrObjectFromXShape(mxShape)); + return pObj && pObj->isLinkAllowed(); }