diff options
author | Henry Castro <hcastro@collabora.com> | 2021-03-02 19:35:01 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2021-03-08 16:50:55 +0100 |
commit | 5b81748d9ef6c57b45bfbd7e4c5790491a97c294 (patch) | |
tree | cfd9e0f00099e4288ff4da858a7b84392952d673 /sfx2 | |
parent | 5f4ab8e319fdfef708b4500616d31355a4d444c0 (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>
Diffstat (limited to 'sfx2')
-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 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")); |