sd/source/ui/dlg/sdtreelb.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit b60705c95bda49b656188d6a75557f32cf8a5f14 Author: Jim Raykowski <rayk...@gmail.com> AuthorDate: Sun Nov 6 14:32:45 2022 -0900 Commit: Jim Raykowski <rayk...@gmail.com> CommitDate: Mon Nov 7 07:17:52 2022 +0100 SdNavigator: Make the page objects tree stand still when the entry selected is already visible (affects tdf#138868 and tdf#129610) This patch replaces the use of TreeView::scroll_to_row with TreeView::set_cursor in SdPageObjsTLV::SelectEntry because the GtkInst scroll_to_row always scrolls the entry to the top, when possible, even if the entry is already in the visible entries range. SalInst only scrolls the entry to the top when it is not in the visible range. Commit 3c8e81669f2311dd35aa6787cbf3e5a6a0520433 'tdf#149279 related: make gtk treeview scroll_to_row more sal like' made the gtk behavior similiar to the sal behavior. Change-Id: I95aa3555699eb8c8d88bb00ca39d7c3a6589353a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142363 Tested-by: Jenkins Reviewed-by: Jim Raykowski <rayk...@gmail.com> diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index d63b1cf13645..226f8fe11eac 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1192,9 +1192,10 @@ void SdPageObjsTLV::SelectEntry(const SdrObject *pObj) { if (weld::fromId<SdrObject*>(m_xTreeView->get_id(*xEntry)) == pObj) { - // only scroll to row of the first selected - if (m_xTreeView->get_selected_rows().empty()) - m_xTreeView->scroll_to_row(*xEntry); + // Only scroll to the row of the first selected. And only when the treeview + // doesn't have the focus. + if (!m_xTreeView->has_focus() && m_xTreeView->get_selected_rows().empty()) + m_xTreeView->set_cursor(*xEntry); m_xTreeView->select(*xEntry); break; }