summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2021-03-02 19:35:01 -0400
committerJan Holesovsky <kendy@collabora.com>2021-03-08 16:50:55 +0100
commit5b81748d9ef6c57b45bfbd7e4c5790491a97c294 (patch)
treecfd9e0f00099e4288ff4da858a7b84392952d673
parent5f4ab8e319fdfef708b4500616d31355a4d444c0 (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>
-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 14885d95710d..d2e437b758b6 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -433,7 +433,28 @@ 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(
+ Application::CreateMessageDialog(
+ pViewFrame->GetWindow().GetFrameWeld(),
+ VclMessageType::Error,
+ VclButtonsType::Ok,
+ aError,
+ true));
+
+ xBox->runAsync(xBox, [](sal_Int32 /*nResult*/) {});
+ }
+ return true;
+ }
+
#ifndef DISABLE_DYNLOADING
+
// load basctl module
osl::Module aMod;
aMod.loadRelative(&thisModule, SVLIBRARY("basctl"));