[gtk/fix-textiter-tests] textbuffer: Fix a test failure
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/fix-textiter-tests] textbuffer: Fix a test failure
- Date: Sun, 2 Aug 2020 21:24:45 +0000 (UTC)
commit 4340f753044044615962b20e9abb6bbc1197333e
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Aug 2 17:23:26 2020 -0400
textbuffer: Fix a test failure
The previous change to gtktextbuffer.c was breaking
the textiter testcase.
gtk/gtktextbuffer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 1f616bdce1..0b03f97c62 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -1605,10 +1605,14 @@ insert_range_not_inside_self (GtkTextBuffer *buffer,
GtkTextIter end = *orig_end;
GtkTextIter range_start;
GtkTextIter range_end;
+ gboolean insert_tags;
if (gtk_text_iter_equal (orig_start, orig_end))
return;
+ insert_tags = gtk_text_buffer_get_tag_table (gtk_text_iter_get_buffer (orig_start))
+ == gtk_text_buffer_get_tag_table (buffer);
+
gtk_text_iter_order (&start, &end);
range_start = start;
@@ -1647,7 +1651,7 @@ insert_range_not_inside_self (GtkTextBuffer *buffer,
restore_range (r);
r = NULL;
- if (gtk_text_buffer_get_tag_table (gtk_text_iter_get_buffer (orig_start)) ==
gtk_text_buffer_get_tag_table (buffer))
+ if (insert_tags)
{
gtk_text_buffer_get_iter_at_offset (buffer, &start_iter, start_offset);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]