Bug 567468 – no check for trailing != NULL in

2009-01-12  Claudio Saavedra  <csaavedra@igalia.com>

	Bug 567468 – no check for trailing != NULL in
	gtk_text_layout_get_iter_at_position()

	* gtk/gtktextlayout.c: (gtk_text_layout_get_iter_at_position):
	Check for trailing to be non-NULL.
	* gtk/gtktextview.c: (gtk_text_view_get_iter_at_position): document
	that trailing may be NULL.


svn path=/trunk/; revision=22090
This commit is contained in:
Claudio Saavedra 2009-01-12 09:57:01 +00:00 committed by Claudio Saavedra
parent 7746eed9b9
commit 42cb64c2f6
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2009-01-12 Claudio Saavedra <csaavedra@igalia.com>
Bug 567468 no check for trailing != NULL in
gtk_text_layout_get_iter_at_position()
* gtk/gtktextlayout.c: (gtk_text_layout_get_iter_at_position):
Check for trailing to be non-NULL.
* gtk/gtktextview.c: (gtk_text_view_get_iter_at_position): document
that trailing may be NULL.
2009-01-11 Tor Lillqvist <tml@iki.fi> 2009-01-11 Tor Lillqvist <tml@iki.fi>
Bug 523554 - Copy from GIMP to Word broken Bug 523554 - Copy from GIMP to Word broken

View File

@ -2654,7 +2654,8 @@ void gtk_text_layout_get_iter_at_position (GtkTextLayout *layout,
if (y > display->height - display->top_margin - display->bottom_margin) if (y > display->height - display->top_margin - display->bottom_margin)
{ {
byte_index = _gtk_text_line_byte_count (line); byte_index = _gtk_text_line_byte_count (line);
*trailing = 0; if (trailing)
*trailing = 0;
} }
else else
{ {

View File

@ -1509,7 +1509,7 @@ gtk_text_view_get_iter_at_location (GtkTextView *text_view,
* gtk_text_view_get_iter_at_position: * gtk_text_view_get_iter_at_position:
* @text_view: a #GtkTextView * @text_view: a #GtkTextView
* @iter: a #GtkTextIter * @iter: a #GtkTextIter
* @trailing: location to store an integer indicating where * @trailing: if non-%NULL, location to store an integer indicating where
* in the grapheme the user clicked. It will either be * in the grapheme the user clicked. It will either be
* zero, or the number of characters in the grapheme. * zero, or the number of characters in the grapheme.
* 0 represents the trailing edge of the grapheme. * 0 represents the trailing edge of the grapheme.