css: Use _gtk_style_property_get_value_type() where appropriate

This commit is contained in:
Benjamin Otte 2012-01-02 00:23:53 +01:00
parent 389531d15d
commit 5ae00c3755
2 changed files with 6 additions and 6 deletions

View File

@ -2356,7 +2356,7 @@ parse_declaration (GtkCssScanner *scanner,
gtk_css_scanner_push_section (scanner, GTK_CSS_SECTION_VALUE);
val = property_value_new (scanner->section);
g_value_init (&val->value, property->pspec->value_type);
g_value_init (&val->value, _gtk_style_property_get_value_type (property));
if (_gtk_style_property_parse_value (property,
&val->value,

View File

@ -244,7 +244,7 @@ _gtk_style_property_resolve (GtkStyleProperty *property,
switch (special)
{
case GTK_CSS_CURRENT_COLOR:
g_assert (property->pspec->value_type == GDK_TYPE_RGBA);
g_assert (_gtk_style_property_get_value_type (property) == GDK_TYPE_RGBA);
gtk_style_properties_get_property (props, "color", state, val);
break;
case GTK_CSS_INHERIT:
@ -255,19 +255,19 @@ _gtk_style_property_resolve (GtkStyleProperty *property,
}
else if (G_VALUE_TYPE (val) == GTK_TYPE_SYMBOLIC_COLOR)
{
if (property->pspec->value_type == GDK_TYPE_RGBA)
if (_gtk_style_property_get_value_type (property) == GDK_TYPE_RGBA)
{
if (resolve_color (props, val))
goto out;
}
else if (property->pspec->value_type == GDK_TYPE_COLOR)
else if (_gtk_style_property_get_value_type (property) == GDK_TYPE_COLOR)
{
if (resolve_color_rgb (props, val))
goto out;
}
g_value_unset (val);
g_value_init (val, property->pspec->value_type);
g_value_init (val, _gtk_style_property_get_value_type (property));
_gtk_style_property_default_value (property, props, state, val);
}
else if (G_VALUE_TYPE (val) == GDK_TYPE_RGBA)
@ -277,7 +277,7 @@ _gtk_style_property_resolve (GtkStyleProperty *property,
}
else if (G_VALUE_TYPE (val) == GTK_TYPE_GRADIENT)
{
g_return_if_fail (property->pspec->value_type == CAIRO_GOBJECT_TYPE_PATTERN);
g_return_if_fail (_gtk_style_property_get_value_type (property) == CAIRO_GOBJECT_TYPE_PATTERN);
if (!resolve_gradient (props, val))
{