mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
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().
This commit is contained in:
parent
04af158605
commit
f508a7b7e2
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -1,3 +1,11 @@
|
||||
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().
|
||||
|
||||
Tue May 22 16:25:27 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeview*.h:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user