summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2009-09-28 12:41:29 -0400
committerMatthias Clasen <mclasen@redhat.com>2009-09-28 12:41:29 -0400
commit894e11e447ad0c4ff49643a2f0e29eb347016c09 (patch)
tree7ab19d557dc11ce6fb9fde684415a71d9856f913
parent7d196b3939e1bbf5eddc5da0980e30c2f38c9cdd (diff)
downloadgtk+-894e11e447ad0c4ff49643a2f0e29eb347016c09.tar.gz
Always initialize out params
This was causing a crash in the appearance capplet, reported in bug 596345.
-rw-r--r--gtk/gtkiconview.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index b3dcb2fe9c..7bfbaa5573 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -3469,6 +3469,9 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
GList *items, *l;
GdkRectangle box;
+ if (cell_at_pos)
+ *cell_at_pos = NULL;
+
for (items = icon_view->priv->items; items; items = items->next)
{
GtkIconViewItem *item = items->data;
@@ -3483,12 +3486,12 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
for (l = icon_view->priv->cell_list; l; l = l->next)
{
GtkIconViewCellInfo *info = (GtkIconViewCellInfo *)l->data;
-
+
if (!info->cell->visible)
continue;
-
+
gtk_icon_view_get_cell_box (icon_view, item, info, &box);
-
+
if ((x >= box.x && x <= box.x + box.width &&
y >= box.y && y <= box.y + box.height) ||
(x >= box.x &&
@@ -3498,14 +3501,11 @@ gtk_icon_view_get_item_at_coords (GtkIconView *icon_view,
{
if (cell_at_pos)
*cell_at_pos = info;
-
+
return item;
}
}
- if (cell_at_pos)
- *cell_at_pos = NULL;
-
if (only_in_cell)
return NULL;
}