[gtk+] shorthand: Remove hack



commit 78fee2f54b3d09d54d69f86dc6c354e9cba0cd0b
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jan 10 19:11:33 2012 +0100

    shorthand: Remove hack
    
    This hack was used for parsing back before the refactoring.

 gtk/gtkcssshorthandpropertyimpl.c |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c
index 95fcbd9..3b0f302 100644
--- a/gtk/gtkcssshorthandpropertyimpl.c
+++ b/gtk/gtkcssshorthandpropertyimpl.c
@@ -800,11 +800,10 @@ unpack_border_color (GtkCssShorthandProperty *shorthand,
                      guint                   *n_params)
 {
   GParameter *parameter = g_new0 (GParameter, 4);
+  gpointer p;
   GType type;
   
   type = G_VALUE_TYPE (value);
-  if (type == G_TYPE_PTR_ARRAY)
-    type = GTK_TYPE_SYMBOLIC_COLOR;
 
   parameter[0].name = "border-top-color";
   g_value_init (&parameter[0].value, type);
@@ -815,24 +814,13 @@ unpack_border_color (GtkCssShorthandProperty *shorthand,
   parameter[3].name = "border-left-color";
   g_value_init (&parameter[3].value, type);
 
-  if (G_VALUE_TYPE (value) == G_TYPE_PTR_ARRAY)
-    {
-      GPtrArray *array = g_value_get_boxed (value);
-      guint i;
-
-      for (i = 0; i < 4; i++)
-        g_value_set_boxed (&parameter[i].value, g_ptr_array_index (array, i));
-    }
-  else
-    {
-      /* can be RGBA or symbolic color */
-      gpointer p = g_value_get_boxed (value);
+  /* can be RGBA or symbolic color */
+  p = g_value_get_boxed (value);
 
-      g_value_set_boxed (&parameter[0].value, p);
-      g_value_set_boxed (&parameter[1].value, p);
-      g_value_set_boxed (&parameter[2].value, p);
-      g_value_set_boxed (&parameter[3].value, p);
-    }
+  g_value_set_boxed (&parameter[0].value, p);
+  g_value_set_boxed (&parameter[1].value, p);
+  g_value_set_boxed (&parameter[2].value, p);
+  g_value_set_boxed (&parameter[3].value, p);
 
   *n_params = 4;
   return parameter;



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