[gtk+/wip/cssvalue: 59/142] styleproperty: Remove default parse function
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssvalue: 59/142] styleproperty: Remove default parse function
- Date: Sat, 7 Apr 2012 19:51:19 +0000 (UTC)
commit dff22a9ee56ed61fb9f5f3fd0e0e46c962899063
Author: Benjamin Otte <otte redhat com>
Date: Tue Mar 27 15:58:22 2012 +0200
styleproperty: Remove default parse function
... and assert every style property brings its own.
gtk/gtkcssstyleproperty.c | 16 ++--------------
gtk/gtkcssstylepropertyimpl.c | 4 ++--
2 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c
index 9a3959d..df8dc09 100644
--- a/gtk/gtkcssstyleproperty.c
+++ b/gtk/gtkcssstyleproperty.c
@@ -274,20 +274,8 @@ gtk_css_style_property_real_parse_value (GtkCssStyleProperty *property,
GtkCssParser *parser,
GFile *base)
{
- GValue value = G_VALUE_INIT;
- GtkCssValue *result;
-
- g_value_init (&value, _gtk_css_style_property_get_specified_type (property));
- if (!_gtk_css_style_parse_value (&value, parser, base))
- {
- g_value_unset (&value);
- return NULL;
- }
-
- result = _gtk_css_value_new_from_gvalue (&value);
- g_value_unset (&value);
-
- return result;
+ g_assert_not_reached ();
+ return NULL;
}
static void
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index a4cb42e..13abf1b 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -65,6 +65,7 @@ gtk_css_style_property_register (const char * name,
GtkCssStyleProperty *node;
g_assert (initial_value != NULL);
+ g_assert (parse_value != NULL);
node = g_object_new (GTK_TYPE_CSS_STYLE_PROPERTY,
"value-type", value_type,
@@ -74,8 +75,7 @@ gtk_css_style_property_register (const char * name,
"name", name,
NULL);
- if (parse_value)
- node->parse_value = parse_value;
+ node->parse_value = parse_value;
if (print_value)
node->print_value = print_value;
if (compute_value)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]