Fix uiTableModel_iter_nth_child.

Remove the iter stamp check from uiTableModel_iter_nth_child:
This is a setter for iter, so no checks should be performed.

As reference: both GtkListStore and GtkTreeStore do not perform
any checks on iter.
This commit is contained in:
Angelo Haller 2020-08-19 13:17:03 -05:00
parent c081c4776f
commit 5d79460d4a
1 changed files with 5 additions and 10 deletions

View File

@ -188,20 +188,15 @@ static gboolean uiTableModel_iter_nth_child(GtkTreeModel *mm, GtkTreeIter *iter,
{
uiTableModel *m = uiTableModel(mm);
g_return_val_if_fail(iter->stamp == m->stamp, FALSE);
if (parent != NULL)
goto bad;
if (n < 0)
goto bad;
if (n >= uiprivTableModelNumRows(m))
goto bad;
iter->stamp = m->stamp;
iter->user_data = GINT_TO_POINTER(n);
return TRUE;
bad:
if (parent != NULL || n < 0 || n >= uiprivTableModelNumRows(m)) {
iter->stamp = 0;
return FALSE;
}
iter->stamp = m->stamp;
iter->user_data = GINT_TO_POINTER(n);
return TRUE;
}
gboolean uiTableModel_iter_parent(GtkTreeModel *mm, GtkTreeIter *iter, GtkTreeIter *child)