diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-22 21:14:41 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-11-24 08:50:18 +0100 |
commit | bfa12f692e0738a0ff10a1d65f91376bb251b774 (patch) | |
tree | 1491f4aba844ab53accf3bec7c6314014f2d84ef | |
parent | e969ea39b13a9fbebfbe1e3b989ec7aa2623a4ea (diff) |
reuse AllowedLinkProtocolFromDocument in impress/draw
Change-Id: I73ca4f087946a45dbf92d69a0dc1e769de9b5690
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159843
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit f0942eed2eb328b04856f20613f5226d66b66a20)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159759
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159859
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 402fd49351123c476650c7280471d05d4de85d5d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159880
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index f3ec8b3df514..aec7a3dcb2d8 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -33,6 +33,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/request.hxx> #include <sfx2/templatedlg.hxx> +#include <svl/stritem.hxx> #include <editeng/eeitem.hxx> #include <svx/svxids.hrc> @@ -193,26 +194,32 @@ void SdModule::Execute(SfxRequest& rReq) { bool bIntercept = false; ::sd::DrawDocShell* pDocShell = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); - if (pDocShell) + ::sd::ViewShell* pViewShell = pDocShell ? pDocShell->GetViewShell() : nullptr; + if (pViewShell) { - ::sd::ViewShell* pViewShell = pDocShell->GetViewShell(); - if (pViewShell) + if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) ) { - if( sd::SlideShow::IsRunning( pViewShell->GetViewShellBase() ) ) + // Prevent documents from opening while the slide + // show is running, except when this request comes + // from a shape interaction. + if (rReq.GetArgs() == nullptr) { - // Prevent documents from opening while the slide - // show is running, except when this request comes - // from a shape interaction. - if (rReq.GetArgs() == nullptr) - { - bIntercept = true; - } + bIntercept = true; } } } if (!bIntercept) { + if (const SfxStringItem* pURLItem = rReq.GetArg<SfxStringItem>(SID_FILE_NAME)) + { + if (!pViewShell || !SfxObjectShell::AllowedLinkProtocolFromDocument(pURLItem->GetValue(), + pViewShell->GetObjectShell(), + pViewShell->GetFrameWeld())) + { + return; + } + } SfxGetpApp()->ExecuteSlot(rReq, SfxGetpApp()->GetInterface()); } else |