diff options
author | Sébastien Wilmet <swilmet@gnome.org> | 2014-08-20 19:06:05 +0200 |
---|---|---|
committer | Sébastien Wilmet <swilmet@gnome.org> | 2014-08-21 18:43:34 +0200 |
commit | 706c8e9c8d29a93fabc1d787894827b709139b6e (patch) | |
tree | be70195da43795b96360e1da12c2738a88bf483c /testsuite/gtk/textiter.c | |
parent | 83bc0c4bb19ac0a61553aba6e9a370aba0ab6e13 (diff) | |
download | gtk+-706c8e9c8d29a93fabc1d787894827b709139b6e.tar.gz |
Simplify _gtk_text_buffer_get_line_log_attrs()
NULL was returned in case of an empty last line. Every users needed to
special-case this. Now it will return the expected result: char_len of 0
with one PangoLogAttr.
In compute_log_attrs(), 'paragraph' will be the empty string "" with
'char_len' == 0.
pango_get_log_attrs() works fine with an empty string, it will return
one correct PangoLogAttr (because there is one text position for the
empty string).
It fixes the unit tests for gtk_text_iter_is_cursor_position().
https://bugzilla.gnome.org/show_bug.cgi?id=156164
Diffstat (limited to 'testsuite/gtk/textiter.c')
-rw-r--r-- | testsuite/gtk/textiter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/gtk/textiter.c b/testsuite/gtk/textiter.c index 21c18699f6..d05a8972de 100644 --- a/testsuite/gtk/textiter.c +++ b/testsuite/gtk/textiter.c @@ -538,8 +538,8 @@ test_cursor_positions (void) check_is_cursor_position ("a\r\n", 0, TRUE); check_is_cursor_position ("a\r\n", 1, TRUE); check_is_cursor_position ("a\r\n", 2, FALSE); - check_is_cursor_position ("a\r\n", 3, FALSE); /* FIXME should be TRUE */ - check_is_cursor_position ("", 0, FALSE); /* FIXME should be TRUE */ + check_is_cursor_position ("a\r\n", 3, TRUE); + check_is_cursor_position ("", 0, TRUE); /* forward */ check_cursor_position ("a\r\nb", TRUE, 0, 1, TRUE); |