treestore: check the first child when moving after nothing

This commit is contained in:
Daemonratte 2026-10-19 13:46:33 +02:00
commit 07976be6d1

View file

@ -2515,15 +2515,13 @@ gtk_tree_store_move (GtkTreeStore *tree_store,
}
else
{
/* move after without position is prepending */
if (depth)
gtk_tree_store_iter_children (GTK_TREE_MODEL (tree_store), &dst_b,
&parent_iter);
/* move after without position is prepending; the row that
* moves is one of the children, so there is a first one */
if (gtk_tree_store_iter_children (GTK_TREE_MODEL (tree_store), &dst_b,
depth ? &parent_iter : NULL))
b = G_NODE (dst_b.user_data);
else
gtk_tree_store_iter_children (GTK_TREE_MODEL (tree_store), &dst_b,
NULL);
b = G_NODE (dst_b.user_data);
b = NULL;
}
/* if a is NULL, b is NULL too -- we are at the end of the list