[Libreoffice-commits] core.git: vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 27 14:06:51 UTC 2021


 vcl/jsdialog/executor.cxx |   22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

New commits:
commit 8ff946045138fde19c0656129da611729aa98cb1
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Apr 21 10:31:07 2021 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Apr 27 16:06:01 2021 +0200

    jsdialog: handle response buttons
    
    Change-Id: I4e8efc4ef2d27e655208ff505167da8360f91a6b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114379
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Mert Tumer <mert.tumer at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114597
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

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);


More information about the Libreoffice-commits mailing list