shorthand: Only unset values that are set

Otherwise g_value_unset() complains. And that breaks the testsuite.
This commit is contained in:
Benjamin Otte 2012-01-31 03:59:32 +01:00
parent f01cef05c8
commit 50c5bf97ea

View File

@ -84,6 +84,13 @@ _gtk_css_shorthand_property_query (GtkStyleProperty *property,
shorthand->query (shorthand, value, query_func, query_data); shorthand->query (shorthand, value, query_func, query_data);
} }
static void
gtk_css_shorthand_property_unset_value (gpointer value)
{
if (G_IS_VALUE (value))
g_value_unset (value);
}
static gboolean static gboolean
gtk_css_shorthand_property_parse_value (GtkStyleProperty *property, gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
GValue *value, GValue *value,
@ -95,7 +102,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property,
guint i; guint i;
array = g_array_new (FALSE, TRUE, sizeof (GValue)); array = g_array_new (FALSE, TRUE, sizeof (GValue));
g_array_set_clear_func (array, (GDestroyNotify) g_value_unset); g_array_set_clear_func (array, gtk_css_shorthand_property_unset_value);
g_array_set_size (array, shorthand->subproperties->len); g_array_set_size (array, shorthand->subproperties->len);
if (_gtk_css_parser_try (parser, "initial", TRUE)) if (_gtk_css_parser_try (parser, "initial", TRUE))