X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-scroll-area.c;h=a04b87fad7e3d7656b7f28326b94e0a94526f0b4;hp=c63106d77c2f535a0d3ab7f05ed508d4d75750b3;hb=976c05744180efac28a9dc421acefcff18659d67;hpb=5ff64b5b4c5c0c8101bd5a4f3a22d20cb6710d77 diff --git a/src/maemo/modest-scroll-area.c b/src/maemo/modest-scroll-area.c index c63106d..a04b87f 100644 --- a/src/maemo/modest-scroll-area.c +++ b/src/maemo/modest-scroll-area.c @@ -161,27 +161,27 @@ static void modest_scroll_area_fixed_allocate (GtkWidget *widget, static int calculate_size (GtkWidget *widget) { - int size = 0; - - if (GTK_IS_TEXT_VIEW (widget)) - return 0; - - if (GTK_IS_CONTAINER (widget)) { - GList *children = gtk_container_get_children (GTK_CONTAINER (widget)); - while (children != NULL) { - GtkWidget *wid = GTK_WIDGET (children->data); - gint sz = calculate_size (wid); - if ((GTK_WIDGET_VISIBLE (wid))) { - size += sz; - } - - children = g_list_next (children); - } - } else { - size = widget->allocation.height; - } - - return size; + int size = 0; + + if (GTK_IS_TEXT_VIEW (widget)) + return 0; + + if (GTK_IS_CONTAINER (widget)) { + GList *tmp = NULL; + GList *children = gtk_container_get_children (GTK_CONTAINER (widget)); + for (tmp = children; tmp != NULL; tmp = g_list_next (tmp)) { + GtkWidget *wid = GTK_WIDGET (tmp->data); + gint sz = calculate_size (wid); + if ((GTK_WIDGET_VISIBLE (wid))) { + size += sz; + } + } + g_list_free (children); + } else { + size = widget->allocation.height; + } + + return size; } static void modest_scroll_area_child_requisition (GtkWidget *widget,