diff options
author | Benjamin Otte <otte@redhat.com> | 2012-01-09 22:06:17 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-01-09 22:08:48 +0100 |
commit | c4566da282f2a7c291c8c148e5ca17d476152259 (patch) | |
tree | 04c6878cb696f4064d3985a82ccfa28412cab8c6 /gtk/gtkcssstyleproperty.c | |
parent | 2dc10600ea430477d3fdd04e659b255e00804609 (diff) | |
download | gtk+-c4566da282f2a7c291c8c148e5ca17d476152259.tar.gz |
styleproperty: Call style properties init function in more places
In particular, call it when querying properties by id. This is necessary
for make check to not die.
Diffstat (limited to 'gtk/gtkcssstyleproperty.c')
-rw-r--r-- | gtk/gtkcssstyleproperty.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gtk/gtkcssstyleproperty.c b/gtk/gtkcssstyleproperty.c index 70d88a721a..d547ce31f3 100644 --- a/gtk/gtkcssstyleproperty.c +++ b/gtk/gtkcssstyleproperty.c @@ -287,6 +287,12 @@ _gtk_css_style_property_get_n_properties (void) GtkCssStylePropertyClass *klass; klass = g_type_class_peek (GTK_TYPE_CSS_STYLE_PROPERTY); + if (G_UNLIKELY (klass == NULL)) + { + _gtk_style_property_init_properties (); + klass = g_type_class_peek (GTK_TYPE_CSS_STYLE_PROPERTY); + g_assert (klass); + } return klass->style_properties->len; } @@ -307,6 +313,13 @@ _gtk_css_style_property_lookup_by_id (guint id) GtkCssStylePropertyClass *klass; klass = g_type_class_peek (GTK_TYPE_CSS_STYLE_PROPERTY); + if (G_UNLIKELY (klass == NULL)) + { + _gtk_style_property_init_properties (); + klass = g_type_class_peek (GTK_TYPE_CSS_STYLE_PROPERTY); + g_assert (klass); + } + g_return_val_if_fail (id < klass->style_properties->len, NULL); return g_ptr_array_index (klass->style_properties, id); } |