]> Pileus Git - ~andy/gtk/commitdiff
shorthand: Fix border query functions
authorBenjamin Otte <otte@redhat.com>
Sat, 7 Apr 2012 05:38:35 +0000 (07:38 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 17 Apr 2012 06:59:20 +0000 (08:59 +0200)
We haven't been using ints there for a while, I wonder why that never
blew up...

gtk/gtkcssshorthandpropertyimpl.c

index b9fb42ba89821fbf3bf55a9105d12320ace35156..9f72a2bbee51be1c2841181e90c6b728555161c8 100644 (file)
@@ -659,24 +659,27 @@ pack_border (GtkCssShorthandProperty *shorthand,
 {
   GtkCssStyleProperty *prop;
   GtkBorder border;
-  GtkCssValue *v;
+  GValue v;
 
   prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 0);
-  v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
-  if (v)
-    border.top = _gtk_css_value_get_int (v);
+  _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
+  border.top = g_value_get_int (&v);
+  g_value_unset (&v);
+
   prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 1);
-  v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
-  if (v)
-    border.right = _gtk_css_value_get_int (v);
+  _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
+  border.right = g_value_get_int (&v);
+  g_value_unset (&v);
+
   prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 2);
-  v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
-  if (v)
-    border.bottom = _gtk_css_value_get_int (v);
+  _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
+  border.bottom = g_value_get_int (&v);
+  g_value_unset (&v);
+
   prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 3);
-  v = (* query_func) (_gtk_css_style_property_get_id (prop), query_data);
-  if (v)
-    border.left = _gtk_css_value_get_int (v);
+  _gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
+  border.left = g_value_get_int (&v);
+  g_value_unset (&v);
 
   g_value_init (value, GTK_TYPE_BORDER);
   g_value_set_boxed (value, &border);