diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-21 10:31:07 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-12 10:51:43 +0200 |
commit | 892219c5f300cd9834b94bd9fc999b1bcdcaf352 (patch) | |
tree | 85b206fb06ea602bc3a1658c4368fae855a5ae07 | |
parent | f05ecc6d6518da976854455996db3fe9144c6bf0 (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>
-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); |