diff options
Diffstat (limited to 'dbaccess/source/ui/querydesign/TableWindowListBox.cxx')
-rw-r--r-- | dbaccess/source/ui/querydesign/TableWindowListBox.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index bef75317d17a..3066f8429f35 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/sdbc/SQLException.hpp> #include <vcl/svapp.hxx> #include <vcl/commandevent.hxx> +#include <o3tl/string_view.hxx> using namespace dbaui; using namespace ::com::sun::star::sdbc; @@ -50,13 +51,22 @@ 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.get()); + rtl::Reference<TransferDataContainer> xHelper(m_xHelper); m_xTreeView->enable_drag_source(xHelper, DND_ACTION_LINK); 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 @@ -83,7 +93,7 @@ void OTableWindowListBox::dispose() InterimItemWindow::dispose(); } -int OTableWindowListBox::GetEntryFromText(const OUString& rEntryText) +int OTableWindowListBox::GetEntryFromText(std::u16string_view rEntryText) { // iterate through the list OJoinDesignView* pView = m_pTabWin->getDesignView(); @@ -102,7 +112,7 @@ int OTableWindowListBox::GetEntryFromText(const OUString& rEntryText) for (int nEntry = 0, nCount = m_xTreeView->n_children(); nEntry < nCount; ++nEntry) { if (bCase ? rEntryText == m_xTreeView->get_text(nEntry) - : rEntryText.equalsIgnoreAsciiCase(m_xTreeView->get_text(nEntry))) + : o3tl::equalsIgnoreAsciiCase(rEntryText, m_xTreeView->get_text(nEntry))) return nEntry; } } |