sd/source/ui/app/sdmod1.cxx |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 277dc083a500e08e7501d8cdb160aabacbefdc49
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Nov 22 21:15:03 2023 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Nov 23 10:04:09 2023 +0100

    set a parent for this warning dialog
    
    Change-Id: I6d71874c3957e9ee4cebb622f702903775ec9aed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159844
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 781181ba7d7b..b211d9c95f94 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -223,7 +223,7 @@ void SdModule::Execute(SfxRequest& rReq)
             }
             else
             {
-                std::unique_ptr<weld::MessageDialog> 
xErrorBox(Application::CreateMessageDialog(nullptr,
+                std::unique_ptr<weld::MessageDialog> 
xErrorBox(Application::CreateMessageDialog(rReq.GetFrameWeld(),
                                                                
VclMessageType::Warning, VclButtonsType::Ok, 
SdResId(STR_CANT_PERFORM_IN_LIVEMODE)));
 
                 xErrorBox->run();
commit f0942eed2eb328b04856f20613f5226d66b66a20
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Wed Nov 22 21:14:41 2023 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Nov 23 10:03:56 2023 +0100

    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.mcnam...@collabora.com>

diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index e35ee5c3e518..781181ba7d7b 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>
@@ -192,26 +193,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

Reply via email to