diff options
author | Jim Raykowski <raykowj@gmail.com> | 2022-10-07 02:18:05 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2022-10-08 02:18:24 +0200 |
commit | 53d5f5e15c005d95fa8c9d24d98e26afd2ca2103 (patch) | |
tree | f25a62a9d7f8191496681a22b3b03191f0eb5663 /vcl/unx/gtk3/gtkinst.cxx | |
parent | 6834fda784f3066a89838cd6cda4fe945f4c7904 (diff) |
tdf#151387 Fix regression cause by tdf#149279
The gtk_tree_view_expand_to_path function not only expands all parent
rows of path as necessary but also expands the children of the row of
the path. This explains the difference seen between gtk3inst and
salinst when a collapsed row is scrolled to. gtk3inst expands the
collapsed row, salinst does not. The enhancement patch for tdf#149279
removed the gtk_tree_view_expand_to_path function from
gtk_tree_view_scroll_to_row. This caused a regression in the styles
tree. To fix the regression this patch reverts the removed
gtk_tree_view_expand_to_path functions. To make the enhancement patch
behave the same for gtk3 and sal, the scroll to row is collapsed
after scrolling if that was it's state before.
Change-Id: I3c3975a3f258c6c432eb866a1c712299e2faf5be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141048
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'vcl/unx/gtk3/gtkinst.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index f0ba23618dcb..a50f98c31ee5 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -15199,6 +15199,7 @@ public: assert(gtk_tree_view_get_model(m_pTreeView) && "don't select when frozen, select after thaw. Note selection doesn't survive a freeze"); disable_notify_events(); GtkTreePath* path = gtk_tree_path_new_from_indices(pos, -1); + gtk_tree_view_expand_to_path(m_pTreeView, path); gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, true, 0, 0); gtk_tree_path_free(path); enable_notify_events(); @@ -15900,6 +15901,7 @@ public: disable_notify_events(); const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter); GtkTreePath* path = gtk_tree_model_get_path(m_pTreeModel, const_cast<GtkTreeIter*>(&rGtkIter.iter)); + gtk_tree_view_expand_to_path(m_pTreeView, path); gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, true, 0, 0); gtk_tree_path_free(path); enable_notify_events(); |