diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-03-08 20:54:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-03-09 11:50:46 +0100 |
commit | ba5c5df41a58c690bdef313856aaad5cd859a455 (patch) | |
tree | 9e49c2b4050c07df3e4c4987340ca99adb5e38c9 | |
parent | 45413702b0b71ee56aee57d215b4041d3ea6067b (diff) |
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@redhat.com>
-rw-r--r-- | include/vcl/weld.hxx | 2 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 5 |
3 files changed, 11 insertions, 0 deletions
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(); |