psppire-output-view: Fix segfault during printing.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 4 Jan 2015 19:13:01 +0000 (11:13 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 4 Jan 2015 19:14:50 +0000 (11:14 -0800)
psppire-output-view tried to make use of a special feature in the
cairo output driver that allowed the cairo_t to be omitted to avoid
actually rendering anything, for pagination purposes, but the cairo
code had changed and this feature had not been carefully maintained,
resulting in a segfault.  This commit stops trying to use that
feature, since it seems like it could easily get broken again in the
future and doesn't have much benefit anyhow.

Bug #43816.
Reported by John Darrington.

src/ui/gui/psppire-output-view.c

index 6e9858c576180c8c2a3d6b93e593dc95a4d38d09..d6e75f32f5b63f7a31a808085843304c9ab747e3 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2008-2014 Free Software Foundation.
+   Copyright (C) 2008-2015 Free Software Foundation.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -839,7 +839,7 @@ paginate (GtkPrintOperation *operation,
                              view->items[view->print_item++].item);
       while (xr_driver_need_new_page (view->print_xrd))
        {
-         xr_driver_next_page (view->print_xrd, NULL);
+         xr_driver_next_page (view->print_xrd, get_cairo_context_from_print_context (context));
          view->print_n_pages ++;
        }
       return FALSE;