From 15e75a08a237ea372170b3ef826e9efae4323a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 17 Aug 2020 09:59:29 +0100 Subject: [PATCH] keep m_nCursorIndex updated with the most recent used entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit so right clicking on the tree keeps current entry selected on re-focus in Change-Id: I25ecb11b8fefbff6464e02936b2a669c34c42b8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100852 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- dbaccess/source/ui/app/AppDetailView.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 3430d0bebb77..640d5195a4df 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -75,10 +75,10 @@ void OTasksWindow::updateHelpText() IMPL_LINK(OTasksWindow, onSelected, weld::TreeView&, rTreeView, bool) { - int nCurEntry = rTreeView.get_cursor_index(); - assert(nCurEntry != -1 && "OTasksWindow::onSelected: invalid entry!"); + m_nCursorIndex = rTreeView.get_cursor_index(); + assert(m_nCursorIndex != -1 && "OTasksWindow::onSelected: invalid entry!"); URL aCommand; - aCommand.Complete = reinterpret_cast(rTreeView.get_id(nCurEntry).toUInt64())->sUNOCommand; + aCommand.Complete = reinterpret_cast(rTreeView.get_id(m_nCursorIndex).toUInt64())->sUNOCommand; getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); return true; @@ -105,6 +105,7 @@ IMPL_LINK_NOARG(OTasksWindow, FocusOutHdl, weld::Widget&, void) IMPL_LINK_NOARG(OTasksWindow, OnEntrySelectHdl, weld::TreeView&, void) { + m_nCursorIndex = m_xTreeView->get_cursor_index(); updateHelpText(); }