so this function was completely broken. Fix it and improve readability.

Thu Apr 18 00:23:31 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreemodelsort.c
        (gtk_tree_model_sort_convert_path_to_child_path): so this function
        was completely broken. Fix it and improve readability.
This commit is contained in:
Kristian Rietveld 2002-04-17 22:26:44 +00:00 committed by Kristian Rietveld
parent 9d03f7d622
commit a3045c84ef
7 changed files with 48 additions and 5 deletions

View File

@ -1,3 +1,9 @@
Thu Apr 18 00:23:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c
(gtk_tree_model_sort_convert_path_to_child_path): so this function
was completely broken. Fix it and improve readability.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small

View File

@ -1,3 +1,9 @@
Thu Apr 18 00:23:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c
(gtk_tree_model_sort_convert_path_to_child_path): so this function
was completely broken. Fix it and improve readability.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small

View File

@ -1,3 +1,9 @@
Thu Apr 18 00:23:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c
(gtk_tree_model_sort_convert_path_to_child_path): so this function
was completely broken. Fix it and improve readability.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small

View File

@ -1,3 +1,9 @@
Thu Apr 18 00:23:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c
(gtk_tree_model_sort_convert_path_to_child_path): so this function
was completely broken. Fix it and improve readability.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small

View File

@ -1,3 +1,9 @@
Thu Apr 18 00:23:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c
(gtk_tree_model_sort_convert_path_to_child_path): so this function
was completely broken. Fix it and improve readability.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small

View File

@ -1,3 +1,9 @@
Thu Apr 18 00:23:31 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreemodelsort.c
(gtk_tree_model_sort_convert_path_to_child_path): so this function
was completely broken. Fix it and improve readability.
2002-04-17 Anders Carlsson <andersca@gnu.org>
* tests/testtreeedit.c (button_press_event): Add a small

View File

@ -1964,19 +1964,26 @@ gtk_tree_model_sort_convert_path_to_child_path (GtkTreeModelSort *tree_model_sor
for (i = 0; i < gtk_tree_path_get_depth (sorted_path); i++)
{
gint count = sorted_indices[i];
if ((level == NULL) ||
(level->array->len <= sorted_indices[i]))
(level->array->len <= count))
{
gtk_tree_path_free (retval);
return NULL;
}
if (g_array_index (level->array, SortElt, sorted_indices[i]).children == NULL)
gtk_tree_model_sort_build_level (tree_model_sort, level, &g_array_index (level->array, SortElt, sorted_indices[i]));
if (g_array_index (level->array, SortElt, count).children == NULL)
gtk_tree_model_sort_build_level (tree_model_sort, level, &g_array_index (level->array, SortElt, count));
if (level == NULL)
break;
{
gtk_tree_path_free (retval);
break;
}
gtk_tree_path_append_index (retval, g_array_index (level->array, SortElt, i).offset);
gtk_tree_path_append_index (retval, g_array_index (level->array, SortElt, count).offset);
level = g_array_index (level->array, SortElt, count).children;
}
return retval;