diff options
author | Benjamin Otte <otte@redhat.com> | 2012-04-30 21:28:57 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-05-01 03:13:02 +0200 |
commit | b4195cb408ed59aa768423e382740f685cf15e60 (patch) | |
tree | c59939068dd2b93d70279a7d3c6ec9497428de20 /gtk/gtkcssmatcher.c | |
parent | 6c63842e689784447ada054c254546fbf326f5f9 (diff) | |
download | gtk+-b4195cb408ed59aa768423e382740f685cf15e60.tar.gz |
cssmatcher: Handle case of empty widget path
This is tested by the stylecontext test, but doesn't appear in practice.
Diffstat (limited to 'gtk/gtkcssmatcher.c')
-rw-r--r-- | gtk/gtkcssmatcher.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c index e67c9eff71..c656ef48e7 100644 --- a/gtk/gtkcssmatcher.c +++ b/gtk/gtkcssmatcher.c @@ -187,16 +187,21 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = { gtk_css_matcher_widget_path_has_position, }; -void +gboolean _gtk_css_matcher_init (GtkCssMatcher *matcher, const GtkWidgetPath *path, GtkStateFlags state) { + if (gtk_widget_path_length (path) == 0) + return FALSE; + matcher->path.klass = >K_CSS_MATCHER_WIDGET_PATH; matcher->path.path = path; matcher->path.state_flags = state; matcher->path.index = gtk_widget_path_length (path) - 1; matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (path, matcher->path.index); + + return TRUE; } /* GTK_CSS_MATCHER_WIDGET_ANY */ |