vcl/jsdialog/executor.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 297abcd5e14ddeb017f2ea2fd39f9db33a069cae
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Jun 28 13:11:42 2022 +0200
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Fri Jul 1 10:46:08 2022 +0200

    jsdialog: add open/close instead of toggle menu from dropdown
    
    it will make us sure we don't reopen popup when we just toggle
    so we will be in sync
    
    Change-Id: I014e824a29d91d5972a6840246bcd4c31d24ae48
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136570
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Rashesh Padia <rashesh.pa...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 8e570ccbe2e4..b0c350b76522 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -330,6 +330,18 @@ bool ExecuteAction(const std::string& nWindowId, const 
OString& rWidget, StringM
                     pToolbar->set_menu_item_active(sId, !bIsActive);
                     return true;
                 }
+                else if (sAction == "closemenu")
+                {
+                    OString sId = OUStringToOString(rData["data"], 
RTL_TEXTENCODING_ASCII_US);
+                    pToolbar->set_menu_item_active(sId, false);
+                    return true;
+                }
+                else if (sAction == "openmenu")
+                {
+                    OString sId = OUStringToOString(rData["data"], 
RTL_TEXTENCODING_ASCII_US);
+                    pToolbar->set_menu_item_active(sId, true);
+                    return true;
+                }
             }
         }
         else if (sControlType == "edit")

Reply via email to