[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 17 21:02:58 UTC 2020


 include/vcl/weld.hxx          |    1 +
 vcl/inc/salvtables.hxx        |    1 +
 vcl/source/app/salvtables.cxx |    4 ++++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   10 ++++++++++
 4 files changed, 16 insertions(+)

New commits:
commit 853df3ce24d4daa113a15d4211be682ada1fa6f2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 17 16:16:09 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Dec 17 22:02:15 2020 +0100

    add Menu::get_sensitive
    
    Change-Id: I242ace497d7f049d9908cc6461b7eefc6d4a2b87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107889
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index d3bdf2ff147f..1265bf774ec7 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2186,6 +2186,7 @@ public:
     void connect_activate(const Link<const OString&, void>& rLink) { m_aActivateHdl = rLink; }
 
     virtual void set_sensitive(const OString& rIdent, bool bSensitive) = 0;
+    virtual bool get_sensitive(const OString& rIdent) const = 0;
     virtual void set_label(const OString& rIdent, const OUString& rLabel) = 0;
     virtual OUString get_label(const OString& rIdent) const = 0;
     virtual void set_active(const OString& rIdent, bool bActive) = 0;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 0a6cbad7038e..b68a2fdeba96 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -143,6 +143,7 @@ public:
     SalInstanceMenu(PopupMenu* pMenu, bool bTakeOwnership);
     virtual OString popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect) override;
     virtual void set_sensitive(const OString& rIdent, bool bSensitive) override;
+    virtual bool get_sensitive(const OString& rIdent) const override;
     virtual void set_active(const OString& rIdent, bool bActive) override;
     virtual bool get_active(const OString& rIdent) const override;
     virtual void set_label(const OString& rIdent, const OUString& rLabel) override;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 167ff5766084..0524244ed6d2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -737,6 +737,10 @@ void SalInstanceMenu::set_sensitive(const OString& rIdent, bool bSensitive)
 {
     m_xMenu->EnableItem(rIdent, bSensitive);
 }
+bool SalInstanceMenu::get_sensitive(const OString& rIdent) const
+{
+    return m_xMenu->IsItemEnabled(m_xMenu->GetItemId(rIdent));
+}
 void SalInstanceMenu::set_active(const OString& rIdent, bool bActive)
 {
     m_xMenu->CheckItem(rIdent, bActive);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 602246395aaa..829a3a4ca58f 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3593,6 +3593,11 @@ public:
         gtk_widget_set_sensitive(GTK_WIDGET(m_aMap[rIdent]), bSensitive);
     }
 
+    bool get_item_sensitive(const OString& rIdent) const
+    {
+        return gtk_widget_get_sensitive(GTK_WIDGET(m_aMap.find(rIdent)->second));
+    }
+
     void set_item_active(const OString& rIdent, bool bActive)
     {
         disable_item_notify_events();
@@ -8199,6 +8204,11 @@ public:
         set_item_sensitive(rIdent, bSensitive);
     }
 
+    virtual bool get_sensitive(const OString& rIdent) const override
+    {
+        return get_item_sensitive(rIdent);
+    }
+
     virtual void set_active(const OString& rIdent, bool bActive) override
     {
         set_item_active(rIdent, bActive);


More information about the Libreoffice-commits mailing list