diff options
author | Alexander Larsson <alexl@redhat.com> | 2011-11-15 17:15:49 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2011-11-17 12:27:23 +0100 |
commit | 8b644b40b1817fc0f93b6e061c8f70ef03e5ff59 (patch) | |
tree | 8f2e028e7e7dfc5caaf15f8718f2d73f4b705107 /gtk | |
parent | 2cf3ff956ae8e12eaeed390a778e3abfe2d4d8c6 (diff) | |
download | gtk+-8b644b40b1817fc0f93b6e061c8f70ef03e5ff59.tar.gz |
make _gtk_style_property_resolve copy the result to an output value
This is preparation for allowing it to return a newly created
value, rather than just copying one.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkstyleproperties.c | 5 | ||||
-rw-r--r-- | gtk/gtkstyleproperty.c | 10 | ||||
-rw-r--r-- | gtk/gtkstylepropertyprivate.h | 3 |
3 files changed, 10 insertions, 8 deletions
diff --git a/gtk/gtkstyleproperties.c b/gtk/gtkstyleproperties.c index b25f92b173..318280277a 100644 --- a/gtk/gtkstyleproperties.c +++ b/gtk/gtkstyleproperties.c @@ -672,10 +672,7 @@ _gtk_style_properties_get_property (GtkStyleProperties *props, g_value_init (value, node->pspec->value_type); if (val) - { - _gtk_style_property_resolve (node, props, state, context, val); - g_value_copy (val, value); - } + _gtk_style_property_resolve (node, props, state, context, val, value); else if (_gtk_style_property_is_shorthand (node)) _gtk_style_property_pack (node, props, state, context, value); else diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c index 2ece9b65de..1c73d30294 100644 --- a/gtk/gtkstyleproperty.c +++ b/gtk/gtkstyleproperty.c @@ -2519,19 +2519,20 @@ _gtk_style_property_resolve (const GtkStyleProperty *property, GtkStyleProperties *props, GtkStateFlags state, GtkStylePropertyContext *context, - GValue *val) + GValue *val, + GValue *val_out) { if (G_VALUE_TYPE (val) == GTK_TYPE_SYMBOLIC_COLOR) { if (property->pspec->value_type == GDK_TYPE_RGBA) { if (resolve_color (props, val)) - return; + goto out; } else if (property->pspec->value_type == GDK_TYPE_COLOR) { if (resolve_color_rgb (props, val)) - return; + goto out; } g_value_unset (val); @@ -2559,6 +2560,9 @@ _gtk_style_property_resolve (const GtkStyleProperty *property, if (!resolve_shadow (props, val)) _gtk_style_property_default_value (property, props, state, val); } + + out: + g_value_copy (val, val_out); } gboolean diff --git a/gtk/gtkstylepropertyprivate.h b/gtk/gtkstylepropertyprivate.h index 07994d5f26..6aa6d59c54 100644 --- a/gtk/gtkstylepropertyprivate.h +++ b/gtk/gtkstylepropertyprivate.h @@ -85,7 +85,8 @@ void _gtk_style_property_resolve (const GtkStyleProper GtkStyleProperties *properties, GtkStateFlags state, GtkStylePropertyContext *context, - GValue *orig_value); + GValue *orig_value, + GValue *out_value); gboolean _gtk_style_property_is_shorthand (const GtkStyleProperty *property); GParameter * _gtk_style_property_unpack (const GtkStyleProperty *property, |