diff options
author | Joe Shaw <joe@ximian.com> | 2001-05-22 20:38:18 +0000 |
---|---|---|
committer | Joe Shaw <joeshaw@src.gnome.org> | 2001-05-22 20:38:18 +0000 |
commit | f508a7b7e2bdee84d29c10f8850857cdea8401c8 (patch) | |
tree | 44769ac0b95961ecd72893debdf3a5a652c13057 /gtk/gtktextiter.c | |
parent | 04af158605b23034b2911da6dfed8ce7c776bd90 (diff) | |
download | gdk-pixbuf-f508a7b7e2bdee84d29c10f8850857cdea8401c8.tar.gz |
Simplify as suggested by Havoc. Just get the last iter and work backward
2001-05-22 Joe Shaw <joe@ximian.com>
* gtk/gtktextiter.c (_gtk_text_btree_get_iter_at_last_toggle):
Simplify as suggested by Havoc. Just get the last iter and work
backward to the tag instead of getting a line and working back from
there. Fixes passing in an invalid offset to
iter_init_from_byte_offset().
Diffstat (limited to 'gtk/gtktextiter.c')
-rw-r--r-- | gtk/gtktextiter.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index 1d5303214..253e104ac 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -4832,27 +4832,14 @@ _gtk_text_btree_get_iter_at_last_toggle (GtkTextBTree *tree, GtkTextIter *iter, GtkTextTag *tag) { - GtkTextLine *line; - g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (tree != NULL, FALSE); - line = _gtk_text_btree_last_could_contain_tag (tree, tag); - - if (line == NULL) - { - /* Set iter to first in tree */ - _gtk_text_btree_get_iter_at_line_char (tree, iter, 0, 0); - check_invariants (iter); - return FALSE; - } - else - { - iter_init_from_byte_offset (iter, tree, line, -1); - gtk_text_iter_backward_to_tag_toggle (iter, tag); - check_invariants (iter); - return TRUE; - } + _gtk_text_btree_get_end_iter (tree, iter); + gtk_text_iter_backward_to_tag_toggle (iter, tag); + check_invariants (iter); + + return TRUE; } gboolean |