vcl/jsdialog/executor.cxx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
New commits: commit eb49b2a989e0765c2955b07c53d55c25c1b0f27b Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Apr 21 10:31:07 2021 +0200 Commit: Mert Tumer <mert.tu...@collabora.com> CommitDate: Mon Apr 26 09:46:22 2021 +0200 jsdialog: handle response buttons Change-Id: I4e8efc4ef2d27e655208ff505167da8360f91a6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114379 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Mert Tumer <mert.tu...@collabora.com> 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits