]> www.fi.muni.cz Git - evince.git/commitdiff
Invert collate action in order to work as expected, fix reverse printing
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 18 Mar 2008 10:45:46 +0000 (10:45 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Tue, 18 Mar 2008 10:45:46 +0000 (10:45 +0000)
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.

svn path=/trunk/; revision=2969

ChangeLog
shell/ev-jobs.c

index 68bcbd18ad31121751f4945bb97f0ec100703dd6..06c23cba8119389d8748d373469b4e2c2f5895f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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):
index f9d17e0bdc33416af0df5faa35c516d75cfc5cbb..d38ef663c6678b7a957e967e025df959adea73d6 100644 (file)
@@ -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;
        }