[gtk+] styleproperties: Use peek_property in get_property



commit b889f499a7f52c79691b273313bfa739f43f4639
Author: Benjamin Otte <otte redhat com>
Date:   Sat May 21 17:43:38 2011 +0200

    styleproperties: Use peek_property in get_property
    
    ... instead of duplicating the code.

 gtk/gtkstyleproperties.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c
index 2b7f90d..f622ca9 100644
--- a/gtk/gtkstyleproperties.c
+++ b/gtk/gtkstyleproperties.c
@@ -857,40 +857,24 @@ gtk_style_properties_get_property (GtkStyleProperties *props,
                                    GtkStateFlags       state,
                                    GValue             *value)
 {
-  GtkStylePropertiesPrivate *priv;
   const GtkStyleProperty *node;
-  PropertyData *prop;
-  GValue *val;
+  const GValue *val;
 
   g_return_val_if_fail (GTK_IS_STYLE_PROPERTIES (props), FALSE);
   g_return_val_if_fail (property != NULL, FALSE);
   g_return_val_if_fail (value != NULL, FALSE);
 
-  node = _gtk_style_property_lookup (property);
+  val = _gtk_style_properties_peek_property (props, property, state, &node);
 
   if (!node)
-    {
-      g_warning ("Style property \"%s\" is not registered", property);
-      return FALSE;
-    }
-
-  priv = props->priv;
-  prop = g_hash_table_lookup (priv->properties, node->pspec);
-
-  if (!prop)
     return FALSE;
 
   g_value_init (value, node->pspec->value_type);
-  val = property_data_match_state (prop, state);
-
-  if (val &&
-      !style_properties_resolve_type (props, node, val))
-    return FALSE;
 
   if (val)
     {
-      g_param_value_validate (node->pspec, val);
       g_value_copy (val, value);
+      g_param_value_validate (node->pspec, value);
     }
   else
     lookup_default_value (node, value);



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