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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Mar 9 10:51:31 UTC 2020


 include/vcl/weld.hxx          |    2 ++
 vcl/source/app/salvtables.cxx |    4 ++++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |    5 +++++
 3 files changed, 11 insertions(+)

New commits:
commit ba5c5df41a58c690bdef313856aaad5cd859a455
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Mar 8 20:54:35 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 9 11:50:46 2020 +0100

    add capability to remove a menu item
    
    Change-Id: Ie87645ea6b477a0d14deb66690d95fd203315ca0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90194
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index aeb656720188..936484a31d0c 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1991,6 +1991,8 @@ public:
                         TriState eCheckRadioFalse)
         = 0;
 
+    virtual void remove(const OString& rId) = 0;
+
     virtual void clear() = 0;
 
     virtual void insert_separator(int pos, const OUString& rId) = 0;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6aa99b7706fd..1d5683a7d392 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -735,6 +735,10 @@ public:
         auto nInsertPos = pos == -1 ? MENU_APPEND : pos;
         m_xMenu->InsertSeparator(rId.toUtf8(), nInsertPos);
     }
+    virtual void remove(const OString& rId) override
+    {
+        m_xMenu->RemoveItem(m_xMenu->GetItemPos(m_xMenu->GetItemId(rId)));
+    }
     virtual int n_children() const override { return m_xMenu->GetItemCount(); }
     PopupMenu* getMenu() const { return m_xMenu.get(); }
     virtual ~SalInstanceMenu() override
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 35e9f8d53742..23dc0c65825a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7352,6 +7352,11 @@ public:
         return nLen;
     }
 
+    void remove(const OString& rIdent) override
+    {
+        MenuHelper::remove_item(rIdent);
+    }
+
     virtual ~GtkInstanceMenu() override
     {
         clear_extras();


More information about the Libreoffice-commits mailing list