summaryrefslogtreecommitdiff
path: root/gtk/gtkframe.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-11-23 11:21:29 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2011-11-23 11:21:29 -0500
commit0d71f62388acce5e264d4d3bb8450756b684e180 (patch)
tree2ae037c80d272cb4437750483d692475b430f333 /gtk/gtkframe.c
parent6a6af8464be090c23ecee6d6a62c188117da36e1 (diff)
downloadgtk+-0d71f62388acce5e264d4d3bb8450756b684e180.tar.gz
frame: don't access padding before it's initialized
Move padding initialization before its first access.
Diffstat (limited to 'gtk/gtkframe.c')
-rw-r--r--gtk/gtkframe.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c
index 275c6ea4ca..c2e1ad2f17 100644
--- a/gtk/gtkframe.c
+++ b/gtk/gtkframe.c
@@ -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;