[Libreoffice-commits] core.git: vcl/unx
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Mar 23 14:23:35 UTC 2020
vcl/unx/gtk3/gtk3gtkinst.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit 6e83e7778d26f35d79ce573b6ee3ab149f7b6179
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Sun Mar 22 20:54:24 2020 -0800
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Mar 23 15:22:51 2020 +0100
GtkInstanceTreeView: Expand to path before setting cursor
Expands the parent of a child, if needed, so the child can be selected.
Change-Id: If4b7322a7024065e5e96ed2ed43289c5ae7c5f5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90899
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 02055e04b15b..46fa3b9cf03a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -10144,6 +10144,14 @@ public:
disable_notify_events();
const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter);
GtkTreeModel *pModel = GTK_TREE_MODEL(m_pTreeStore);
+ GtkTreeIter Iter;
+ if (gtk_tree_model_iter_parent(pModel, &Iter, const_cast<GtkTreeIter*>(&rGtkIter.iter)))
+ {
+ GtkTreePath* path = gtk_tree_model_get_path(pModel, &Iter);
+ if (!gtk_tree_view_row_expanded(m_pTreeView, path))
+ gtk_tree_view_expand_to_path(m_pTreeView, path);
+ gtk_tree_path_free(path);
+ }
GtkTreePath* path = gtk_tree_model_get_path(pModel, const_cast<GtkTreeIter*>(&rGtkIter.iter));
gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
gtk_tree_view_set_cursor(m_pTreeView, path, nullptr, false);
More information about the Libreoffice-commits
mailing list