From d2ef71627b5021108086143c0afaefb9ee196a7d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 18 May 2011 18:32:22 +0200 Subject: css: Make property parsing functions take a css parser Instead of reading a string and then passing that in, let the parse functions use the full power of the parser. --- gtk/gtkcssparser.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gtk/gtkcssparser.c') diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c index de798e781a..c956fd5bb9 100644 --- a/gtk/gtkcssparser.c +++ b/gtk/gtkcssparser.c @@ -107,6 +107,15 @@ _gtk_css_parser_get_position (GtkCssParser *parser) return parser->data - parser->line_start; } +void +_gtk_css_parser_take_error (GtkCssParser *parser, + GError *error) +{ + parser->error_func (parser, error, parser->user_data); + + g_error_free (error); +} + void _gtk_css_parser_error (GtkCssParser *parser, const char *format, @@ -122,9 +131,7 @@ _gtk_css_parser_error (GtkCssParser *parser, format, args); va_end (args); - parser->error_func (parser, error, parser->user_data); - - g_error_free (error); + _gtk_css_parser_take_error (parser, error); } static gboolean -- cgit v1.2.1