vcl/unx/gtk3/gtkinst.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit f0c2719baadee4b2b315d61d39ce35bfbddfffcc Author: Caolán McNamara <[email protected]> AuthorDate: Tue Sep 27 12:27:19 2022 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Sep 27 15:14:16 2022 +0200 tdf#150916 make unselect in combobox dropdown same as initially unselected a similar issue as seen in tdf#148197 Change-Id: I3848fe7b48f6148a5ae13d484c866953fed83c90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140647 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 499215667252..155974cdbd95 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -21149,22 +21149,24 @@ private: void tree_view_set_cursor(int pos) { + GtkTreePath* path; if (pos == -1) { + path = gtk_tree_path_new(); gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(m_pTreeView)); if (m_pCellView) gtk_cell_view_set_displayed_row(m_pCellView, nullptr); } else { - GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1); + path = gtk_tree_path_new_from_indices(pos, -1); if (gtk_tree_view_get_model(m_pTreeView)) gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0); - gtk_tree_view_set_cursor(m_pTreeView, path, nullptr, false); if (m_pCellView) gtk_cell_view_set_displayed_row(m_pCellView, path); - gtk_tree_path_free(path); } + gtk_tree_view_set_cursor(m_pTreeView, path, nullptr, false); + gtk_tree_path_free(path); } int tree_view_get_cursor() const
