From: Carlos Garcia Campos Date: Tue, 18 Mar 2008 10:45:46 +0000 (+0000) Subject: Invert collate action in order to work as expected, fix reverse printing X-Git-Tag: EVINCE_2_22_1~23 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=5d949a64fcb3f3be02cb5ce4466043c8bdb33f31;p=evince.git Invert collate action in order to work as expected, fix reverse printing 2008-03-18 Carlos Garcia Campos * shell/ev-jobs.c: (ev_job_print_run): Invert collate action in order to work as expected, fix reverse printing so that it doesn't start with a blank page and fix number of copies. Patch by Eugen Dedu. Fixes bug #365332. svn path=/trunk/; revision=2969 --- diff --git a/ChangeLog b/ChangeLog index 68bcbd18..06c23cba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-18 Carlos Garcia Campos + + * shell/ev-jobs.c: (ev_job_print_run): + + Invert collate action in order to work as expected, fix reverse + printing so that it doesn't start with a blank page and fix number + of copies. Patch by Eugen Dedu. Fixes bug #365332. + 2008-03-14 Carlos Garcia Campos * backend/pdf/ev-poppler.cc: (pdf_selection_render_selection): diff --git a/shell/ev-jobs.c b/shell/ev-jobs.c index f9d17e0b..d38ef663 100644 --- a/shell/ev-jobs.c +++ b/shell/ev-jobs.c @@ -922,33 +922,32 @@ ev_job_print_run (EvJobPrint *job) gint n_copies; step = job->reverse ? -1 * job->pages_per_sheet : job->pages_per_sheet; - page = job->reverse ? (n_pages / job->pages_per_sheet) * job->pages_per_sheet : 0; - n_copies = job->collate ? job->copies : 1; + page = job->reverse ? ((n_pages - 1) / job->pages_per_sheet) * job->pages_per_sheet : 0; + n_copies = job->collate ? 1 : job->copies; while ((job->reverse && (page >= 0)) || (!job->reverse && (page < n_pages))) { gint k; - ev_file_exporter_begin_page (EV_FILE_EXPORTER (document)); - - for (j = 0; j < job->pages_per_sheet; j++) { - gint p = page + j; + for (k = 0; k < n_copies; k++) { + ev_file_exporter_begin_page (EV_FILE_EXPORTER (document)); - if (p < 0 || p >= n_pages) - break; + for (j = 0; j < job->pages_per_sheet; j++) { + gint p = page + j; - ev_render_context_set_page (rc, page_list[p]); - - for (k = 0; k < n_copies; k++) { + if (p < 0 || p >= n_pages) + break; + + ev_render_context_set_page (rc, page_list[p]); ev_file_exporter_do_page (EV_FILE_EXPORTER (document), rc); } - } - ev_file_exporter_end_page (EV_FILE_EXPORTER (document)); + ev_file_exporter_end_page (EV_FILE_EXPORTER (document)); + } page += step; } - if (job->collate) + if (!job->collate) break; }