diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-21 10:31:07 +0200 |
---|---|---|
committer | Mert Tumer <mert.tumer@collabora.com> | 2021-04-26 09:46:22 +0200 |
commit | eb49b2a989e0765c2955b07c53d55c25c1b0f27b (patch) | |
tree | 8ec8c6f4e7f2997d1e19c74bda3143a78cde3b36 /vcl | |
parent | 002b7a87b3b3edf0a28cc910510f766ae01bcb99 (diff) |
jsdialog: handle response buttons
Change-Id: I4e8efc4ef2d27e655208ff505167da8360f91a6b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114379
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/jsdialog/executor.cxx | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 16096c6dcf01..4ce9b50e0364 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -48,11 +48,27 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat { weld::Widget* pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, rWidget); - if (pWidget != nullptr) + OUString sControlType = rData["type"]; + OUString sAction = rData["cmd"]; + + if (sControlType == "responsebutton") { - OUString sControlType = rData["type"]; - OUString sAction = rData["cmd"]; + if (pWidget == nullptr) + { + // welded wrapper not found - use response code instead + pWidget = JSInstanceBuilder::FindWeldWidgetsMap(nWindowId, "__DIALOG__"); + sControlType = "dialog"; + sAction = "response"; + } + else + { + // welded wrapper for button found - use it + sControlType = "pushbutton"; + } + } + if (pWidget != nullptr) + { if (sControlType == "tabcontrol") { auto pNotebook = dynamic_cast<weld::Notebook*>(pWidget); |