diff options
author | Timm Bäder <mail@baedert.org> | 2018-07-15 18:08:30 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2018-07-17 17:33:47 +0200 |
commit | f699fff6e005f1e5fe253f4a977993d4321c5568 (patch) | |
tree | 792f42d038e2c2bcc583a4e920ff57438d4128f7 /gtk/gtksizerequest.c | |
parent | 4bc145549d3b0e56f9abb0231420b76b492a0205 (diff) | |
download | gtk+-f699fff6e005f1e5fe253f4a977993d4321c5568.tar.gz |
sizerequest: Pull locals into closest scope
Diffstat (limited to 'gtk/gtksizerequest.c')
-rw-r--r-- | gtk/gtksizerequest.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c index 49af81071b..78f369e589 100644 --- a/gtk/gtksizerequest.c +++ b/gtk/gtksizerequest.c @@ -414,11 +414,6 @@ gtk_widget_measure (GtkWidget *widget, int *minimum_baseline, int *natural_baseline) { - GHashTable *widgets; - GHashTableIter iter; - gpointer key; - gint min_result = 0, nat_result = 0; - g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (for_size >= -1); g_return_if_fail (orientation == GTK_ORIENTATION_HORIZONTAL || @@ -445,37 +440,44 @@ gtk_widget_measure (GtkWidget *widget, { gtk_widget_query_size_for_orientation (widget, orientation, for_size, minimum, natural, minimum_baseline, natural_baseline); - return; } + else + { + GHashTable *widgets; + GHashTableIter iter; + gpointer key; + int min_result = 0, nat_result = 0; - widgets = _gtk_size_group_get_widget_peers (widget, orientation); + widgets = _gtk_size_group_get_widget_peers (widget, orientation); - g_hash_table_iter_init (&iter, widgets); - while (g_hash_table_iter_next (&iter, &key, NULL)) - { - GtkWidget *tmp_widget = key; - gint min_dimension, nat_dimension; + g_hash_table_iter_init (&iter, widgets); + while (g_hash_table_iter_next (&iter, &key, NULL)) + { + GtkWidget *tmp_widget = key; + int min_dimension, nat_dimension; - gtk_widget_query_size_for_orientation (tmp_widget, orientation, for_size, &min_dimension, &nat_dimension, NULL, NULL); + gtk_widget_query_size_for_orientation (tmp_widget, orientation, for_size, + &min_dimension, &nat_dimension, NULL, NULL); - min_result = MAX (min_result, min_dimension); - nat_result = MAX (nat_result, nat_dimension); - } + min_result = MAX (min_result, min_dimension); + nat_result = MAX (nat_result, nat_dimension); + } - g_hash_table_destroy (widgets); + g_hash_table_destroy (widgets); - /* Baselines make no sense with sizegroups really */ - if (minimum_baseline) - *minimum_baseline = -1; + /* Baselines make no sense with sizegroups really */ + if (minimum_baseline) + *minimum_baseline = -1; - if (natural_baseline) - *natural_baseline = -1; + if (natural_baseline) + *natural_baseline = -1; - if (minimum) - *minimum = min_result; + if (minimum) + *minimum = min_result; - if (natural) - *natural = nat_result; + if (natural) + *natural = nat_result; + } } /** |