summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2023-02-15 23:52:53 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2023-03-03 17:30:52 +0000
commit00ac4d375922b96d94e42846c9555d22470fb2f6 (patch)
tree46f9690ed006dbaa382404f13710978d36c1cb8d /vcl/source
parent3fce5f707789fe623672e2eebd731756c826dadc (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/source')
-rw-r--r--vcl/source/app/salvtables.cxx5
-rw-r--r--vcl/source/app/svapp.cxx1
-rw-r--r--vcl/source/window/builder.cxx5
-rw-r--r--vcl/source/window/dialog.cxx3
4 files changed, 11 insertions, 3 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index eb2697b61b03..f8dcfba0a16b 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1696,6 +1696,11 @@ weld::ScreenShotCollection SalInstanceWindow::collect_screenshot_data()
return aRet;
}
+const vcl::ILibreOfficeKitNotifier* SalInstanceWindow::GetLOKNotifier()
+{
+ return m_xWindow ? m_xWindow->GetLOKNotifier() : nullptr;
+}
+
SalInstanceWindow::~SalInstanceWindow()
{
// tdf#129745 only undo overriding child help for the normal case, not for
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index d2c6294917f0..a580a8215cdb 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -319,6 +319,7 @@ void Application::notifyWindow(vcl::LOKWindowId /*nLOKWindowId*/,
const OUString& /*rAction*/,
const std::vector<vcl::LOKPayloadItem>& /*rPayload = std::vector<LOKPayloadItem>()*/) const
{
+ SAL_WARN("vcl", "Invoked not implemented method: Application::notifyWindow");
}
void Application::libreOfficeKitViewCallback(int nType, const char* pPayload) const
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 2463c68182a6..047fd6e4ae9c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -213,10 +213,11 @@ std::unique_ptr<weld::Builder> Application::CreateInterimBuilder(vcl::Window* pP
}
weld::MessageDialog* Application::CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
- VclButtonsType eButtonType, const OUString& rPrimaryMessage)
+ VclButtonsType eButtonType, const OUString& rPrimaryMessage,
+ const ILibreOfficeKitNotifier* pNotifier)
{
if (comphelper::LibreOfficeKit::isActive())
- return JSInstanceBuilder::CreateMessageDialog(pParent, eMessageType, eButtonType, rPrimaryMessage);
+ return JSInstanceBuilder::CreateMessageDialog(pParent, eMessageType, eButtonType, rPrimaryMessage, pNotifier);
else
return ImplGetSVData()->mpDefInst->CreateMessageDialog(pParent, eMessageType, eButtonType, rPrimaryMessage);
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index b8d81a4b8130..a255ed4b9a47 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1131,7 +1131,8 @@ void Dialog::EndDialog( tools::Long nResult )
{
if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
{
- pNotifier->notifyWindow(GetLOKWindowId(), "close");
+ if (mpDialogImpl->m_bLOKTunneling)
+ pNotifier->notifyWindow(GetLOKWindowId(), "close");
ReleaseLOKNotifier();
}
}