From: Ben Pfaff Date: Sun, 4 Jan 2015 19:13:01 +0000 (-0800) Subject: psppire-output-view: Fix segfault during printing. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=9fd97e410494b051da21490040e4a5b5de2d5a2a psppire-output-view: Fix segfault during printing. 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. --- diff --git a/src/ui/gui/psppire-output-view.c b/src/ui/gui/psppire-output-view.c index 6e9858c576..d6e75f32f5 100644 --- a/src/ui/gui/psppire-output-view.c +++ b/src/ui/gui/psppire-output-view.c @@ -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;