Don't crash if the path does not point to a row in the model. (#300909,

2005-04-29  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkiconview.c (gtk_icon_view_select_path): Don't crash
	if the path does not point to a row in the model.  (#300909,
	Mathias Hasselmann)
This commit is contained in:
Matthias Clasen 2005-04-29 14:56:37 +00:00 committed by Matthias Clasen
parent 3f9ade6436
commit 5ce761a2e6
4 changed files with 18 additions and 8 deletions

View File

@ -1,5 +1,9 @@
2005-04-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconview.c (gtk_icon_view_select_path): Don't crash
if the path does not point to a row in the model. (#300909,
Mathias Hasselmann)
* tests/testtext.c: Add some more attribute tests.
* gtk/gtktexttag.c (gtk_text_tag_class_init): Correct the documentation

View File

@ -1,5 +1,9 @@
2005-04-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconview.c (gtk_icon_view_select_path): Don't crash
if the path does not point to a row in the model. (#300909,
Mathias Hasselmann)
* tests/testtext.c: Add some more attribute tests.
* gtk/gtktexttag.c (gtk_text_tag_class_init): Correct the documentation

View File

@ -1,5 +1,9 @@
2005-04-29 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkiconview.c (gtk_icon_view_select_path): Don't crash
if the path does not point to a row in the model. (#300909,
Mathias Hasselmann)
* tests/testtext.c: Add some more attribute tests.
* gtk/gtktexttag.c (gtk_text_tag_class_init): Correct the documentation

View File

@ -3480,19 +3480,17 @@ void
gtk_icon_view_select_path (GtkIconView *icon_view,
GtkTreePath *path)
{
GtkIconViewItem *item;
GList *l;
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
g_return_if_fail (icon_view->priv->model != NULL);
g_return_if_fail (path != NULL);
item = g_list_nth (icon_view->priv->items,
gtk_tree_path_get_indices(path)[0])->data;
l = g_list_nth (icon_view->priv->items,
gtk_tree_path_get_indices(path)[0]);
if (!item)
return;
gtk_icon_view_select_item (icon_view, item);
if (l != NULL)
gtk_icon_view_select_item (icon_view, l->data);
}
/**