]> git.tdb.fi Git - ext/subsurface.git/blobdiff - print.c
Separate out the UI from the program logic
[ext/subsurface.git] / print.c
diff --git a/print.c b/print.c
index 0fe958a008095a1ea596556cc1d15116ee21a263..af7fc4cd6c232368ebe6adcaa111a626b17f88cd 100644 (file)
--- a/print.c
+++ b/print.c
@@ -2,6 +2,7 @@
 
 #include "dive.h"
 #include "display.h"
+#include "display-gtk.h"
 
 static void draw_page(GtkPrintOperation *operation,
                        GtkPrintContext *context,
@@ -22,7 +23,8 @@ static void draw_page(GtkPrintOperation *operation,
        h = gtk_print_context_get_height(context);
 
        /* Do the profile on the top half of the page.. */
-       plot(&gc, w, h/2, current_dive);
+       if (current_dive)
+               plot(&gc, w, h/2, current_dive);
 
        pango_cairo_show_layout(cr,layout);
        g_object_unref(layout);