summaryrefslogtreecommitdiff
path: root/src/gtkext/gtkblockview.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-02-22 23:49:58 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-02-22 23:49:58 (GMT)
commit1991abdadab865243168c4ff8f744e07110a01ad (patch)
tree491467251278baf4e6729d54c61c068e81d45196 /src/gtkext/gtkblockview.c
parent2d95ce74200c8cb7c328535235a8c8e74686794e (diff)
Avoided crashes when loading unrecognized files.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@142 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext/gtkblockview.c')
-rw-r--r--src/gtkext/gtkblockview.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gtkext/gtkblockview.c b/src/gtkext/gtkblockview.c
index ae4b1a8..a4f0d3e 100644
--- a/src/gtkext/gtkblockview.c
+++ b/src/gtkext/gtkblockview.c
@@ -318,6 +318,8 @@ static void g_delayed_insertion_process(GDelayedInsertion *insertion, GtkExtStat
lines = GTK_BIN_VIEW(view)->lines;
last = GTK_BIN_VIEW(view)->last;
+ if (lines == NULL) return;
+
iter = g_rendering_line_loop_for_code(lines, last);
start = get_rendering_line_address(lines);
@@ -867,6 +869,8 @@ static gboolean gtk_block_view_expose(GtkWidget *widget, GdkEventExpose *event)
mark = gtk_text_iter_get_marks(&iter)->data;
line = g_object_get_data(G_OBJECT(mark), "line");
+ if (line == NULL) break;
+
flags = g_rendering_line_get_flags(line);
if (flags & RLF_RUNNING_BP)
@@ -1081,6 +1085,8 @@ static void gtk_block_view_complete_building_content(GDelayedInsertion *insertio
gtk_text_layout_set_buffer(view->layout, view->buffer);
+ gtk_text_layout_set_cursor_visible(GTK_BLOCK_VIEW(view)->layout, FALSE);
+
gtk_text_buffer_get_end_iter(view->buffer, &pos);
gtk_text_layout_move_iter_visually(view->layout, &pos, -1);
gtk_text_layout_get_iter_location(view->layout, &pos, &rect);