diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2023-02-15 23:52:53 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-03-03 17:30:52 +0000 |
commit | 00ac4d375922b96d94e42846c9555d22470fb2f6 (patch) | |
tree | 46f9690ed006dbaa382404f13710978d36c1cb8d /vcl/jsdialog/jsdialogbuilder.cxx | |
parent | 3fce5f707789fe623672e2eebd731756c826dadc (diff) |
lok: macro: VBA message dialogs was causing assertion failure
Get VBA MsgBox and VBA Runtime Script Error dialogs to be displayed
correctly without causing an assertion failure.
Provided a solution that allows VBA MsgBox to be executed in a
not-async way so that the VBA script is paused until the message box
is closed.
Change-Id: Ica7d0d343a0ea4b6a163c1c43572f18a5779a0ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147243
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147321
Tested-by: Jenkins
Diffstat (limited to 'vcl/jsdialog/jsdialogbuilder.cxx')
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index ff6466d4b565..389bd4528ccb 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -1165,17 +1165,20 @@ std::unique_ptr<weld::Image> JSInstanceBuilder::weld_image(const OString& id) return pWeldWidget; } -weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent, - VclMessageType eMessageType, - VclButtonsType eButtonType, - const OUString& rPrimaryMessage) +weld::MessageDialog* +JSInstanceBuilder::CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType, + VclButtonsType eButtonType, const OUString& rPrimaryMessage, + const vcl::ILibreOfficeKitNotifier* pNotifier) { SalInstanceWidget* pParentInstance = dynamic_cast<SalInstanceWidget*>(pParent); SystemWindow* pParentWidget = pParentInstance ? pParentInstance->getSystemWindow() : nullptr; VclPtrInstance<::MessageDialog> xMessageDialog(pParentWidget, rPrimaryMessage, eMessageType, eButtonType); - const vcl::ILibreOfficeKitNotifier* pNotifier = xMessageDialog->GetLOKNotifier(); + if (pNotifier) + xMessageDialog->SetLOKNotifier(pNotifier); + + pNotifier = xMessageDialog->GetLOKNotifier(); if (pNotifier) { tools::JsonWriter aJsonWriter; @@ -1465,6 +1468,18 @@ void JSMessageDialog::RememberMessageDialog() JSInstanceBuilder::RememberWidget(sWindowId, sWidgetName, this); } +int JSMessageDialog::run() +{ + if (GetLOKNotifier()) + { + RememberMessageDialog(); + sendFullUpdate(); + } + + int bRet = SalInstanceMessageDialog::run(); + return bRet; +} + bool JSMessageDialog::runAsync(std::shared_ptr<weld::DialogController> aOwner, const std::function<void(sal_Int32)>& rEndDialogFn) { |