diff options
author | Benjamin Otte <otte@redhat.com> | 2011-05-21 19:43:11 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-05-22 01:23:36 +0200 |
commit | 0a368fe622b41963cea587a7444362d5a8eaad68 (patch) | |
tree | 2cb43cef29a361e6f583a94f4fa00a2666936c5c /gtk | |
parent | e7db09062025e6e4a75577ee36f5a8e3f277930e (diff) | |
download | gtk+-0a368fe622b41963cea587a7444362d5a8eaad68.tar.gz |
styleproperties: Validate values when setting them
Note that validation is not necessary when resolving, because all values
are valid for those cases.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkstyleproperties.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c index 0bfd3aec9d..99bb3411ed 100644 --- a/gtk/gtkstyleproperties.c +++ b/gtk/gtkstyleproperties.c @@ -533,6 +533,8 @@ _gtk_style_properties_set_property_by_pspec (GtkStyleProperties *props, } g_value_copy (value, val); + if (pspec->value_type == value_type) + g_param_value_validate (pspec, val); } /** @@ -625,6 +627,7 @@ gtk_style_properties_set_valist (GtkStyleProperties *props, G_VALUE_COLLECT_INIT (val, node->pspec->value_type, args, 0, &error); + g_param_value_validate (node->pspec, val); if (error) { g_warning ("Could not set style property \"%s\": %s", property_name, error); @@ -872,10 +875,7 @@ gtk_style_properties_get_property (GtkStyleProperties *props, g_value_init (value, node->pspec->value_type); if (val) - { - g_value_copy (val, value); - g_param_value_validate (node->pspec, value); - } + g_value_copy (val, value); else lookup_default_value (node, value); @@ -931,7 +931,6 @@ gtk_style_properties_get_valist (GtkStyleProperties *props, if (val) { - g_param_value_validate (node->pspec, val); G_VALUE_LCOPY (val, args, 0, &error); } else |