summaryrefslogtreecommitdiff
path: root/gtk/gtktextiter.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2001-12-31 16:31:51 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-12-31 16:31:51 +0000
commita307ffbf11b321dbd85563b64febfd333bec987c (patch)
tree282e82e0143f84946247b8e6d5595e3dcc519039 /gtk/gtktextiter.c
parent5c6ef7990c9fc034a1b5dc7a80bdcf69690ad7cc (diff)
downloadgtk+-a307ffbf11b321dbd85563b64febfd333bec987c.tar.gz
fix to use ensure_byte_offsets not ensure_char_offsets, patch from Padraig
2001-12-31 Havoc Pennington <hp@pobox.com> * gtk/gtktextiter.c (gtk_text_iter_get_visible_line_index): fix to use ensure_byte_offsets not ensure_char_offsets, patch from Padraig O'Briain bug #67356
Diffstat (limited to 'gtk/gtktextiter.c')
-rw-r--r--gtk/gtktextiter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index f28834f837..3399b88544 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -732,9 +732,11 @@ gtk_text_iter_get_visible_line_offset (const GtkTextIter *iter)
ensure_char_offsets (real);
check_invariants (iter);
-
+
vis_offset = real->line_char_offset;
+ g_assert (vis_offset >= 0);
+
_gtk_text_btree_get_iter_at_line (real->tree,
&pos,
real->line,
@@ -792,12 +794,14 @@ gtk_text_iter_get_visible_line_index (const GtkTextIter *iter)
if (real == NULL)
return 0;
- ensure_char_offsets (real);
+ ensure_byte_offsets (real);
check_invariants (iter);
vis_offset = real->line_byte_offset;
+ g_assert (vis_offset >= 0);
+
_gtk_text_btree_get_iter_at_line (real->tree,
&pos,
real->line,