[gtk+/wip/cssvalue: 132/142] shorthand: Fix border query functions



commit c023d569acc7225832fa92ef0f8411e8349aa5fc
Author: Benjamin Otte <otte redhat com>
Date:   Sat Apr 7 07:38:35 2012 +0200

    shorthand: Fix border query functions
    
    We haven't been using ints there for a while, I wonder why that never
    blew up...

 gtk/gtkcssshorthandpropertyimpl.c |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index 7150c75..362d260 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -661,24 +661,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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]