summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2008-08-11 18:17:23 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2008-08-11 18:17:23 +0000
commit681f92d78c2623ddb998018d3743a54f07680b69 (patch)
tree1d5bc35072d9c55b4bd155b65e6bd53f289ec22e /pango
parent5ed20a3adf877fb463c7bf5442a32ad59082fe5b (diff)
downloadpango-681f92d78c2623ddb998018d3743a54f07680b69.tar.gz
Bug 547303 – pango_layout_get_cursor_pos crashes on certain text buffers
2008-08-11 Behdad Esfahbod <behdad@gnome.org> Bug 547303 – pango_layout_get_cursor_pos crashes on certain text buffers * pango/pango-layout.c (pango_layout_get_cursor_pos): Handle cursor position in the middle of a "\r\n" cluster. svn path=/trunk/; revision=2688
Diffstat (limited to 'pango')
-rw-r--r--pango/pango-layout.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 1df4b03c..262b4035 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2194,6 +2194,14 @@ pango_layout_get_cursor_pos (PangoLayout *layout,
else
x1_trailing = line_rect.width;
}
+ else if (index >= layout_line->start_index + layout_line->length)
+ {
+ dir1 = layout_line->resolved_dir;
+ if (layout_line->resolved_dir == PANGO_DIRECTION_LTR)
+ x1_trailing = line_rect.width;
+ else
+ x1_trailing = 0;
+ }
else
{
gint prev_index = g_utf8_prev_char (layout->text + index) - layout->text;