summaryrefslogtreecommitdiff
path: root/gtk/gtkcssshorthandproperty.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-01-02 04:11:20 +0100
committerBenjamin Otte <otte@redhat.com>2012-01-09 18:37:54 +0100
commita0606d513c57aac367df8dd74732b5efacc27f7e (patch)
treead97368d2452b38f1091fcb3adf6a60b9d426bfd /gtk/gtkcssshorthandproperty.c
parent442040876a0b97d44442226f78419dbbe2570cd9 (diff)
downloadgtk+-a0606d513c57aac367df8dd74732b5efacc27f7e.tar.gz
shorthand: Initialize unparsed values
All values that the parse funcs didn't parse are initialized to 'initial'.
Diffstat (limited to 'gtk/gtkcssshorthandproperty.c')
-rw-r--r--gtk/gtkcssshorthandproperty.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtkcssshorthandproperty.c b/gtk/gtkcssshorthandproperty.c
index 79fb1d24f0..5d86e54ac7 100644
--- a/gtk/gtkcssshorthandproperty.c
+++ b/gtk/gtkcssshorthandproperty.c
@@ -141,6 +141,18 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
return FALSE;
}
+ /* All values that aren't set by the parse func are set to their
+ * default values here.
+ * XXX: Is the default always initial or can it be inherit? */
+ for (i = 0; i < shorthand->subproperties->len; i++)
+ {
+ GValue *val = g_value_array_get_nth (array, i);
+ if (G_IS_VALUE (val))
+ continue;
+ g_value_init (val, GTK_TYPE_CSS_SPECIAL_VALUE);
+ g_value_set_enum (val, GTK_CSS_INITIAL);
+ }
+
g_value_unset (value);
g_value_init (value, G_TYPE_VALUE_ARRAY);
g_value_set_boxed (value, array);