+2008-03-18 Carlos Garcia Campos <carlosgc@gnome.org>
+
+ * 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 <carlosgc@gnome.org>
* backend/pdf/ev-poppler.cc: (pdf_selection_render_selection):
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;
}