summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevgen Muntyan <muntyan@tamu.edu>2007-11-15 17:00:33 +0000
committerYevgen Muntyan <muntyan@src.gnome.org>2007-11-15 17:00:33 +0000
commit921da326f5dd7fed5ef01b32b7269ea8fc4bf745 (patch)
treee6d1b76dc3bcb8295063372d738453b572e10253
parenta3eb6a98d7a497b1f8bb5a73d497ce673d942837 (diff)
downloadgtk+-921da326f5dd7fed5ef01b32b7269ea8fc4bf745.tar.gz
sort returned tags array by tags priority (#497102).
2007-11-15 Yevgen Muntyan <muntyan@tamu.edu> * gtk/gtktextbtree.c (_gtk_text_btree_get_tags): sort returned tags array by tags priority (#497102). * gtk/gtktextiter.c (gtk_text_iter_get_tags), (gtk_text_iter_get_attributes): * gtk/gtktextlayout.c (get_tags_array_at_iter): and do not sort it here. svn path=/trunk/; revision=18995
-rw-r--r--ChangeLog7
-rw-r--r--gtk/gtktextbtree.c6
-rw-r--r--gtk/gtktextiter.c6
-rw-r--r--gtk/gtktextlayout.c2
4 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 478650737d..fa7141ee1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2007-11-15 Yevgen Muntyan <muntyan@tamu.edu>
+ * gtk/gtktextbtree.c (_gtk_text_btree_get_tags): sort returned
+ tags array by tags priority (#497102).
+ * gtk/gtktextiter.c (gtk_text_iter_get_tags), (gtk_text_iter_get_attributes):
+ * gtk/gtktextlayout.c (get_tags_array_at_iter): and do not sort it here.
+
+2007-11-15 Yevgen Muntyan <muntyan@tamu.edu>
+
* gtk/gtktextlayout.c: (gtk_text_layout_get_line_display),
(get_style): do not call _gtk_text_btree_get_iter_at_line() and
_gtk_text_btree_get_tags() for every segment, instead call them
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c
index b170c58525..9232d8c244 100644
--- a/gtk/gtktextbtree.c
+++ b/gtk/gtktextbtree.c
@@ -2196,6 +2196,8 @@ _gtk_text_btree_get_line_at_char (GtkTextBTree *tree,
return line;
}
+/* It returns an array sorted by tags priority, ready to pass to
+ * _gtk_text_attributes_fill_from_tags() */
GtkTextTag**
_gtk_text_btree_get_tags (const GtkTextIter *iter,
gint *num_tags)
@@ -2304,6 +2306,10 @@ _gtk_text_btree_get_tags (const GtkTextIter *iter,
g_free (tagInfo.tags);
return NULL;
}
+
+ /* Sort tags in ascending order of priority */
+ _gtk_text_tag_array_sort (tagInfo.tags, dst);
+
return tagInfo.tags;
}
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index 715f7e5964..5ab52dc130 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -1331,9 +1331,6 @@ gtk_text_iter_get_tags (const GtkTextIter *iter)
return NULL;
}
- /* Sort tags in ascending order of priority */
- _gtk_text_tag_array_sort (tags, tag_count);
-
retval = NULL;
i = 0;
while (i < tag_count)
@@ -1748,9 +1745,6 @@ gtk_text_iter_get_attributes (const GtkTextIter *iter,
return FALSE;
}
- /* Sort tags in ascending order of priority */
- _gtk_text_tag_array_sort (tags, tag_count);
-
_gtk_text_attributes_fill_from_tags (values,
tags,
tag_count);
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 0b1b708f8c..f09a04d9a8 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -2072,8 +2072,6 @@ get_tags_array_at_iter (GtkTextIter *iter)
if (n_tags > 0)
{
- /* Sort tags in ascending order of priority */
- _gtk_text_tag_array_sort (tags, n_tags);
array = g_ptr_array_sized_new (n_tags);
g_ptr_array_set_size (array, n_tags);
memcpy (array->pdata, tags, n_tags * sizeof (GtkTextTag*));