* src/widgets/modest-header-view.c:
[modest] / src / widgets / modest-hbox-cell-renderer.c
index 4f443cd..568ea8e 100644 (file)
@@ -30,7 +30,6 @@
 #include <config.h>
 
 #include <glib/gi18n-lib.h>
-
 #include <gtk/gtkwidget.h>
 
 #include <modest-text-utils.h>
@@ -187,6 +186,7 @@ modest_hbox_cell_renderer_append (ModestHBoxCellRenderer *hbox_renderer,
 #if GLIB_CHECK_VERSION(2, 10, 0) /* g_object_ref_sink() was added in glib 2.10: */
        g_object_ref_sink (G_OBJECT (cell));
 #else
+       g_object_ref (G_OBJECT (cell));
        gtk_object_sink (GTK_OBJECT (cell));
 #endif
 }
@@ -264,15 +264,11 @@ modest_hbox_cell_renderer_render       (GtkCellRenderer       *cell,
        GList *node = NULL;
        GtkCellRenderer *child;
        gint width, extra;
-       GtkRequisition req;
        
        direction = gtk_widget_get_direction (widget);
        nvis_children = 0;
        nexpand_children = 0;
 
-       /* first, retrieve the requisition of the children cell renderers */
-       modest_hbox_cell_renderer_get_size (cell, widget, NULL, NULL, NULL, &(req.width), &(req.height));
-
        /* Counts visible and expandable children cell renderers */
        for (node = priv->renderers_list; node != NULL; node = g_list_next (node)) {
                gboolean visible, expand;
@@ -293,6 +289,10 @@ modest_hbox_cell_renderer_render       (GtkCellRenderer       *cell,
                GdkRectangle child_alloc;
 
                if (nexpand_children > 0) {
+                       GtkRequisition req;
+
+                       /* retrieve the requisition of the children cell renderers */
+                       modest_hbox_cell_renderer_get_size (cell, widget, NULL, NULL, NULL, &(req.width), &(req.height));
                        width = cell_area->width - req.width;
                        extra = width / nexpand_children;
                } else {
@@ -316,7 +316,6 @@ modest_hbox_cell_renderer_render       (GtkCellRenderer       *cell,
                                GtkRequisition child_req;
                                gint child_xpad, child_ypad;
                                GdkRectangle child_expose_area;
-
                                gtk_cell_renderer_get_size (child, widget, NULL, NULL, NULL, &(child_req.width), &(child_req.height));
                                g_object_get (child, "xpad", &child_xpad, "ypad", &child_ypad, NULL);