diff --git a/ChangeLog b/ChangeLog index fa7141ee1a..2275bc0ddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-15 Yevgen Muntyan + + * gtk/gtktextbtree.h: + * gtk/gtktextbtree.c: new functions _gtk_text_btree_get_insert() + and _gtk_text_btree_get_selection_bound() (#497102). + * gtk/gtktextbuffer.c (gtk_text_buffer_get_insert), + (gtk_text_buffer_get_selection_bound): use them here instead of + hash table lookup. + 2007-11-15 Yevgen Muntyan * gtk/gtktextbtree.c (_gtk_text_btree_get_tags): sort returned diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index 9232d8c244..81038f427a 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -2972,6 +2972,18 @@ _gtk_text_btree_mark_is_selection_bound (GtkTextBTree *tree, return segment == tree->selection_bound_mark; } +GtkTextMark * +_gtk_text_btree_get_insert (GtkTextBTree *tree) +{ + return tree->insert_mark; +} + +GtkTextMark * +_gtk_text_btree_get_selection_bound (GtkTextBTree *tree) +{ + return tree->selection_bound_mark; +} + GtkTextMark* _gtk_text_btree_get_mark_by_name (GtkTextBTree *tree, const gchar *name) diff --git a/gtk/gtktextbtree.h b/gtk/gtktextbtree.h index 053d9e1a20..627b2fc681 100644 --- a/gtk/gtktextbtree.h +++ b/gtk/gtktextbtree.h @@ -200,12 +200,13 @@ void _gtk_text_btree_place_cursor (GtkTextBTree const GtkTextIter *where); void _gtk_text_btree_select_range (GtkTextBTree *tree, const GtkTextIter *ins, - const GtkTextIter -*bound); + const GtkTextIter *bound); gboolean _gtk_text_btree_mark_is_insert (GtkTextBTree *tree, GtkTextMark *segment); gboolean _gtk_text_btree_mark_is_selection_bound (GtkTextBTree *tree, GtkTextMark *segment); +GtkTextMark *_gtk_text_btree_get_insert (GtkTextBTree *tree); +GtkTextMark *_gtk_text_btree_get_selection_bound (GtkTextBTree *tree); GtkTextMark *_gtk_text_btree_get_mark_by_name (GtkTextBTree *tree, const gchar *name); GtkTextLine * _gtk_text_btree_first_could_contain_tag (GtkTextBTree *tree, diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index bf48251152..12f34de127 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -2296,8 +2296,7 @@ gtk_text_buffer_get_insert (GtkTextBuffer *buffer) { g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); - /* FIXME use struct member in btree */ - return gtk_text_buffer_get_mark (buffer, "insert"); + return _gtk_text_btree_get_insert (get_btree (buffer)); } /** @@ -2323,8 +2322,7 @@ gtk_text_buffer_get_selection_bound (GtkTextBuffer *buffer) { g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), NULL); - /* FIXME use struct member in btree */ - return gtk_text_buffer_get_mark (buffer, "selection_bound"); + return _gtk_text_btree_get_selection_bound (get_btree (buffer)); } /**