]> www.fi.muni.cz Git - evince.git/commitdiff
Inverse order printing, bug #320919.
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 18 Feb 2006 09:28:41 +0000 (09:28 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sat, 18 Feb 2006 09:28:41 +0000 (09:28 +0000)
* shell/ev-print-job.c: (idle_print_handler):

Inverse order printing, bug #320919.

ChangeLog
shell/ev-print-job.c

index 038d7156fdab49d22d450d7fb62ebda1395fcaa0..3dba8080d0ab385de00e6f0026d24a005176ab4f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-18  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-print-job.c: (idle_print_handler):
+       
+       Inverse order printing, bug #320919.
+
 2006-02-17  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * data/evince-toolbar.xml:
index bb463f96108d33f57fd1e8522800350832bf18a8..59a8130d93da5d0b7be050b822b16b4994ba0a17 100644 (file)
@@ -61,6 +61,7 @@ struct _EvPrintJob {
        gboolean printing;
        int next_page;
        int copies_done;
+       int shift;
 };
 
 struct _EvPrintJobClass {
@@ -261,15 +262,18 @@ idle_print_handler (EvPrintJob *job)
                ev_document_doc_mutex_lock ();
                ev_ps_exporter_begin (
                         EV_PS_EXPORTER (job->document),
-                        job->temp_file, job->first_page, job->last_page,
+                        job->temp_file, 
+                       MIN (job->first_page, job->last_page),
+                       MAX (job->first_page, job->last_page),
                         job->width, job->height, job->duplex);
                ev_document_doc_mutex_unlock ();
                job->next_page = job->first_page;
+               job->shift = (job->first_page > job->last_page) ? -1 : 1;
                job->printing = TRUE;
                return TRUE;
        }
-
-       if (job->next_page <= job->last_page) {
+       
+       if ((job->next_page - job->last_page) * job->shift <= 0) {
                EvRenderContext *rc;
 #if 0
                g_printerr ("Printing page %d\n", job->next_page);
@@ -286,12 +290,12 @@ idle_print_handler (EvPrintJob *job)
                        /* collate must repeat the same page */
                        job->copies_done++;
                        if(job->copies == job->copies_done) {
-                               job->next_page++;
+                               job->next_page += job->shift;
                                job->copies_done = 0;
                        }
                } else {
-                       job->next_page++;
-                       if (job->next_page > job->last_page){
+                       job->next_page += job->shift;
+                       if ((job->next_page - job->last_page) * job->shift > 0){
                                job->copies_done++;
                                if(job->copies_done < job->copies) {
                                        /* more copies to go, restart to the first page */