From: Ben Pfaff Date: Fri, 2 Dec 2011 06:06:48 +0000 (-0800) Subject: gui: Fix printing of tables split across pages in psppire-output-window. X-Git-Tag: v0.7.9~68 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=769fb2e87faed46645d19564859648dbddb38589;p=pspp-builds.git gui: Fix printing of tables split across pages in psppire-output-window. xr_driver_output_item() expects the caller to call xr_driver_next_page() as long as xr_driver_need_new_page() returns true, but the printing code didn't do that, so tables split across pages in printouts caused an assertion failure at the next call to xr_driver_output_item(). Reported-by: John Darrington --- diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index a0e74790..beb1e9a8 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -1003,7 +1003,7 @@ paginate (GtkPrintOperation *operation, if ( window->print_item < window->n_items ) { xr_driver_output_item (window->print_xrd, window->items[window->print_item++]); - if (xr_driver_need_new_page (window->print_xrd)) + while (xr_driver_need_new_page (window->print_xrd)) { xr_driver_next_page (window->print_xrd, NULL); window->print_n_pages ++; @@ -1046,12 +1046,9 @@ draw_page (GtkPrintOperation *operation, PsppireOutputWindow *window) { xr_driver_next_page (window->print_xrd, gtk_print_context_get_cairo_context (context)); - while ( window->print_item < window->n_items) - { - xr_driver_output_item (window->print_xrd, window->items [window->print_item++]); - if ( xr_driver_need_new_page (window->print_xrd) ) - break; - } + while (!xr_driver_need_new_page (window->print_xrd) + && window->print_item < window->n_items) + xr_driver_output_item (window->print_xrd, window->items [window->print_item++]); }