aboutsummaryrefslogtreecommitdiff
path: root/libstorycode
diff options
context:
space:
mode:
Diffstat (limited to 'libstorycode')
-rw-r--r--libstorycode/gtk/gtkslideview.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libstorycode/gtk/gtkslideview.c b/libstorycode/gtk/gtkslideview.c
index 240b348..0990a6f 100644
--- a/libstorycode/gtk/gtkslideview.c
+++ b/libstorycode/gtk/gtkslideview.c
@@ -196,6 +196,8 @@ static int get_cursor_pos(SlideItem *item, Stylesheet *stylesheet,
PangoRectangle rect;
double padl, padr, padt, padb;
+ if ( item->paras == NULL ) return 1;
+
if ( item->paras[cpos.para].layout == NULL ) {
fprintf(stderr, "get_cursor_pos: No layout\n");
return 1;
@@ -550,6 +552,14 @@ static int find_cursor(SlideItem *item, Stylesheet *stylesheet,
x -= padl;
y -= padt;
+ if ( item->paras == NULL ) {
+ printf("No paragraphs (item %p)!\n", item);
+ pos->para = 0;
+ pos->pos = 0;
+ pos->trail = 0;
+ return 0;
+ }
+
do {
PangoRectangle rect;
pango_layout_get_extents(item->paras[i++].layout, NULL, &rect);