diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-05-10 11:27:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-05-10 15:05:19 +0200 |
commit | 5e245445200c5d094bb7eef76d8df3077b799ac5 (patch) | |
tree | fef15b7e3568c09edc3d12ff0f6bdc45e76e47fb /vcl/unx/gtk3 | |
parent | 476ed0aed1c09055fa05209485919a026e5f014e (diff) |
weld SdCustomShowDlg and SdDefineCustomShowDlg
Change-Id: I44d40a286eb5d70982284a270f340653858d38cf
Reviewed-on: https://gerrit.libreoffice.org/54076
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index f0cbf0ed97e4..7b972cebea00 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3128,17 +3128,17 @@ public: { assert(gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen"); disable_notify_events(); - if (pos != -1) + if (pos == -1 || (pos == 0 && n_children() == 0)) + { + gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(m_pTreeView)); + } + else { GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1); gtk_tree_selection_select_path(gtk_tree_view_get_selection(m_pTreeView), path); gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0); gtk_tree_path_free(path); } - else - { - gtk_tree_selection_unselect_all(gtk_tree_view_get_selection(m_pTreeView)); - } enable_notify_events(); } @@ -3146,15 +3146,15 @@ public: { assert(gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen"); disable_notify_events(); - if (pos != -1) + if (pos == -1 || (pos == 0 && n_children() == 0)) { - GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1); - gtk_tree_selection_unselect_path(gtk_tree_view_get_selection(m_pTreeView), path); - gtk_tree_path_free(path); + gtk_tree_selection_select_all(gtk_tree_view_get_selection(m_pTreeView)); } else { - gtk_tree_selection_select_all(gtk_tree_view_get_selection(m_pTreeView)); + GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1); + gtk_tree_selection_unselect_path(gtk_tree_view_get_selection(m_pTreeView), path); + gtk_tree_path_free(path); } enable_notify_events(); } |