cui/source/dialogs/scriptdlg.cxx |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 1c1604cf6ca6012efcc7f1642906ce686081b3c4
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Mar 2 19:58:08 2021 -0400
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Thu Mar 4 16:09:00 2021 +0100

    lok: async exception dialog messages for VBA macros
    
    Change-Id: Ia713343541f8102de85f7ac57202780afba3da00
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111855
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 12da15e0c2b6..e6238f7c665c 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -20,6 +20,7 @@
 #include <memory>
 #include <utility>
 
+#include <sfx2/viewfrm.hxx>
 #include <sal/log.hxx>
 #include <sfx2/objsh.hxx>
 #include <vcl/svapp.hxx>
@@ -46,6 +47,7 @@
 #include <com/sun/star/script/XInvocation.hpp>
 #include <com/sun/star/document/XEmbeddedScripts.hpp>
 
+#include <comphelper/lok.hxx>
 #include <comphelper/SetFlagContextHelper.hxx>
 #include <comphelper/documentinfo.hxx>
 #include <comphelper/processfactory.hxx>
@@ -1343,10 +1345,18 @@ IMPL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, 
void*, p, void )
         message = CuiResId( RID_SVXSTR_ERROR_TITLE );
     }
 
-    std::unique_ptr<weld::MessageDialog> 
xBox(Application::CreateMessageDialog(nullptr,
-                                              VclMessageType::Warning, 
VclButtonsType::Ok, message));
+    const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+    std::shared_ptr<weld::MessageDialog> xBox(
+        Application::CreateMessageDialog(
+            pViewFrame->GetWindow().GetFrameWeld(),
+            VclMessageType::Warning,
+            VclButtonsType::Ok,
+            message,
+            comphelper::LibreOfficeKit::isActive() ? true : false));
+
     xBox->set_title(CuiResId(RID_SVXSTR_ERROR_TITLE));
-    xBox->run();
+
+    xBox->runAsync(xBox, [](sal_Int32 /*nResult*/) {});
 
     delete pMessage;
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to