diff options
author | Henry Castro <hcastro@collabora.com> | 2021-03-02 19:35:01 -0400 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2021-04-09 14:47:08 +0100 |
commit | 31daa9fd1e6aed4ccc79a7b8d869a2fe532f0199 (patch) | |
tree | 09fe0776b35e5fb4037a07a9b997d95811e8c0ff | |
parent | 528f93ea1bb791f2bee78fca0e2c090b7e234136 (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.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index f3138419f4a3..ed0596250056 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -29,6 +29,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> @@ -390,6 +391,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")); |