summaryrefslogtreecommitdiff
path: root/tests/testboxcss.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-06-17 07:39:11 +0200
committerBenjamin Otte <otte@redhat.com>2011-08-26 16:26:28 +0200
commit26e9d0771848e6a7ff510dd1819788781968edaa (patch)
tree7216ac794ed263e7ba71ee32e809c4d4ec2f9f67 /tests/testboxcss.c
parent8d6b560ff366394374dc0a96005cac14efe8d5ac (diff)
downloadgtk+-26e9d0771848e6a7ff510dd1819788781968edaa.tar.gz
API: cssprovider: Change parsing-error signal
Instead of path, line and position, emit the section the error happened in. This has a lot more information to consume.
Diffstat (limited to 'tests/testboxcss.c')
-rw-r--r--tests/testboxcss.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/testboxcss.c b/tests/testboxcss.c
index 2ae081b577..17d576e10c 100644
--- a/tests/testboxcss.c
+++ b/tests/testboxcss.c
@@ -49,20 +49,21 @@
static void
show_parsing_error (GtkCssProvider *provider,
- const gchar *path,
- guint line,
- guint position,
+ GtkCssSection *section,
const GError *error,
GtkTextBuffer *buffer)
{
GtkTextIter start, end;
const char *tag_name;
- gtk_text_buffer_get_iter_at_line (buffer, &start, line - 1);
- if (gtk_text_buffer_get_line_count (buffer) <= line)
- gtk_text_buffer_get_end_iter (buffer, &end);
- else
- gtk_text_buffer_get_iter_at_line (buffer, &end, line);
+ gtk_text_buffer_get_iter_at_line_index (buffer,
+ &start,
+ gtk_css_section_get_start_line (section),
+ gtk_css_section_get_start_position (section));
+ gtk_text_buffer_get_iter_at_line_index (buffer,
+ &end,
+ gtk_css_section_get_end_line (section),
+ gtk_css_section_get_end_position (section));
if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED))
tag_name = "warning";