summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2021-03-02 19:35:01 -0400
committerHenry Castro <hcastro@collabora.com>2021-04-07 22:18:33 +0200
commitbb91e70bfb25d678560184ddcc294ff9fbb377af (patch)
tree697b5f5e31106e0b2531854737d939a1ad6bd16f
parentae4512f5e7cfb1b309cc9c48bbe798546c0a3f2a (diff)
lok: show error message dialog for VBA macros
It creates and exclusive message dialog to show the VBA errors to client side. Otherwise the IDE window to show the source code and the error message is not supported yet. Change-Id: Ie74f911b109cb13aebd39de2cb8e899d779c1cf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111854 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113689 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
-rw-r--r--sfx2/source/appl/app.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 78358b32fe22..bad0e60b41b4 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -28,6 +28,7 @@
#include <svl/svdde.hxx>
#include <unotools/configmgr.hxx>
#include <com/sun/star/frame/XFrame.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
@@ -405,6 +406,26 @@ IMPL_STATIC_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBas
return false;
#else
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OUString aError;
+ std::unique_ptr<ErrorInfo> pErrorInfo = ErrorInfo::GetErrorInfo(StarBASIC::GetErrorCode());
+ if (ErrorStringFactory::CreateString(pErrorInfo.get(), aError))
+ {
+ const SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+ std::shared_ptr<weld::MessageDialog> xBox;
+ xBox.reset(Application::CreateMessageDialog(
+ pViewFrame->GetWindow().GetFrameWeld(),
+ VclMessageType::Error,
+ VclButtonsType::Ok,
+ aError,
+ true));
+
+ xBox->runAsync(xBox, [](sal_Int32 /*nResult*/) {});
+ }
+ return true;
+ }
+
#ifndef DISABLE_DYNLOADING
basicide_handle_basic_error pSymbol = reinterpret_cast<basicide_handle_basic_error>(sfx2::getBasctlFunction("basicide_handle_basic_error"));