vcl/unx/gtk3/gtkinst.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 8e9c818f87b20b07d6180d56eaed858740b4d76c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Sep 27 12:27:19 2022 +0100 Commit: Adolfo Jayme Barrientos <fit...@ubuntu.com> CommitDate: Tue Sep 27 16:03:24 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/+/140605 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index ca361523a359..690f39a50208 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -20820,22 +20820,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