frame: don't access padding before it's initialized

Move padding initialization before its first access.
This commit is contained in:
Cosimo Cecchi 2011-11-23 11:21:29 -05:00
parent 6a6af8464b
commit 0d71f62388

View File

@ -860,6 +860,9 @@ gtk_frame_get_preferred_size (GtkWidget *request,
gint minimum, natural;
guint border_width;
get_padding_and_border (frame, &padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
@ -902,9 +905,6 @@ gtk_frame_get_preferred_size (GtkWidget *request,
}
}
get_padding_and_border (frame, &padding);
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
minimum += (border_width * 2) + padding.left + padding.right;