Commit 374c8554 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Handle _gtk_text_line_get_data() returning NULL in all cases. (Coverity)

2006-04-12  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtktextlayout.c (gtk_text_layout_validate_yrange):
	Handle _gtk_text_line_get_data() returning NULL in all
	cases.  (Coverity)
parent 5977f7f0
2006-04-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_validate_yrange):
Handle _gtk_text_line_get_data() returning NULL in all
cases. (Coverity)
* gtk/gtkuimanager.c: Make find_menu_position and
find_toolbar_position void. (#338100)
......
2006-04-12 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_validate_yrange):
Handle _gtk_text_line_get_data() returning NULL in all
cases. (Coverity)
* gtk/gtkuimanager.c: Make find_menu_position and
find_toolbar_position void. (#338100)
......
......@@ -943,16 +943,20 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout,
GtkTextLineData *line_data = _gtk_text_line_get_data (line, layout);
if (!line_data || !line_data->valid)
{
gint old_height = line_data ? line_data->height : 0;
gint old_height, new_height;
old_height = line_data ? line_data->height : 0;
_gtk_text_btree_validate_line (_gtk_text_buffer_get_btree (layout->buffer),
line, layout);
line_data = _gtk_text_line_get_data (line, layout);
delta_height += line_data->height - old_height;
new_height = line_data ? line_data->height : 0;
delta_height += new_height - old_height;
first_line = line;
first_line_y = -seen - line_data->height;
first_line_y = -seen - new_height;
if (!last_line)
{
last_line = line;
......@@ -960,7 +964,7 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout,
}
}
seen += line_data->height;
seen += line_data ? line_data->height : 0;
line = _gtk_text_line_previous (line);
}
......@@ -972,13 +976,16 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout,
GtkTextLineData *line_data = _gtk_text_line_get_data (line, layout);
if (!line_data || !line_data->valid)
{
gint old_height = line_data ? line_data->height : 0;
gint old_height, new_height;
old_height = line_data ? line_data->height : 0;
_gtk_text_btree_validate_line (_gtk_text_buffer_get_btree (layout->buffer),
line, layout);
line_data = _gtk_text_line_get_data (line, layout);
new_height = line_data ? line_data->height : 0;
delta_height += line_data->height - old_height;
delta_height += new_height - old_height;
if (!first_line)
{
......@@ -986,10 +993,10 @@ gtk_text_layout_validate_yrange (GtkTextLayout *layout,
first_line_y = seen;
}
last_line = line;
last_line_y = seen + line_data->height;
last_line_y = seen + new_height;
}
seen += line_data->height;
seen += line_data ? line_data->height : 0;
line = _gtk_text_line_next_excluding_last (line);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment