Related: tdf#148197 gtk_tree_view_scroll_to_cell needs either path or column
so a null path is invalid here
Change-Id: I1958e9695e3290e0c513bce89c9548908860754f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134280
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index a2439b6..38f8d3c 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14724,8 +14724,14 @@ public:
virtual void set_cursor(int pos) override
{
disable_notify_events();
GtkTreePath* path = pos != -1 ? gtk_tree_path_new_from_indices(pos, -1) : nullptr;
gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
GtkTreePath* path;
if (pos != -1)
{
path = gtk_tree_path_new_from_indices(pos, -1);
gtk_tree_view_scroll_to_cell(m_pTreeView, path, nullptr, false, 0, 0);
}
else
path = gtk_tree_path_new();
gtk_tree_view_set_cursor(m_pTreeView, path, nullptr, false);
gtk_tree_path_free(path);
enable_notify_events();