summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-04-21 10:31:07 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2021-04-27 16:06:01 +0200
commit8ff946045138fde19c0656129da611729aa98cb1 (patch)
treee99865640f8480db3052079b347c4e67b7aa1692
parent4722ad2cf3f2b91c217e3548f811f2972f2aa60c (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114597 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--vcl/jsdialog/executor.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 0e3fdc358eaa..72faac5c639c 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -45,11 +45,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);