[Libreoffice-commits] core.git: dbaccess/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 16 13:44:45 UTC 2021


 dbaccess/source/ui/inc/TableWindowListBox.hxx         |    1 +
 dbaccess/source/ui/querydesign/TableWindowListBox.cxx |    9 +++++++++
 2 files changed, 10 insertions(+)

New commits:
commit 932441bfc7953198dd8db4cf929857f63e05c207
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 16 10:17:14 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Feb 16 14:44:04 2021 +0100

    show context menu on right click in treeview
    
    Change-Id: I2a124d63309130b0488e30169aa54ffbc736999f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110983
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx
index d41cdbc3e285..0d3890cf26c7 100644
--- a/dbaccess/source/ui/inc/TableWindowListBox.hxx
+++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx
@@ -55,6 +55,7 @@ namespace dbaui
         std::unique_ptr<TableWindowListBoxHelper> m_xDragDropTargetHelper;
 
         DECL_LINK( OnDoubleClick, weld::TreeView&, bool );
+        DECL_LINK(CommandHdl, const CommandEvent&, bool);
         DECL_LINK( DropHdl, void*, void );
         DECL_LINK( LookForUiHdl, void*, void );
         DECL_LINK( DragBeginHdl, bool&, bool );
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index a289f185683f..a1a8a17c4735 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -50,6 +50,7 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent)
 {
     m_xTreeView->connect_row_activated(LINK(this, OTableWindowListBox, OnDoubleClick));
     m_xTreeView->connect_visible_range_changed(LINK(this, OTableWindowListBox, ScrollHdl));
+    m_xTreeView->connect_popup_menu(LINK(this, OTableWindowListBox, CommandHdl));
 
     m_xHelper.set(new OJoinExchObj);
     rtl::Reference<TransferDataContainer> xHelper(m_xHelper);
@@ -57,6 +58,14 @@ OTableWindowListBox::OTableWindowListBox(OTableWindow* pParent)
     m_xTreeView->connect_drag_begin(LINK(this, OTableWindowListBox, DragBeginHdl));
 }
 
+IMPL_LINK(OTableWindowListBox, CommandHdl, const CommandEvent&, rCEvt, bool)
+{
+    if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
+        return false;
+    m_pTabWin->Command(rCEvt);
+    return true;
+}
+
 void OTableWindowListBox::dragFinished()
 {
     // first show the error msg when existing


More information about the Libreoffice-commits mailing list