Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>2005-10-26 19:34:23 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2005-10-26 19:34:23 (GMT)
commit0d19025d51e4a14ae553a4fc877c04261a11c902 (patch)
treea2c934492a39c79eec3df866aad67d5dabd2c524
parentf752e58fede08754c341607af94b4167600aed41 (diff)
Fix for bug Bug 318916: Printing multiple pages.
* shell/ev-print-job.c: (idle_print_handler): Fix for bug Bug 318916: Printing multiple pages.
-rw-r--r--ChangeLog6
-rw-r--r--shell/ev-print-job.c25
2 files changed, 27 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d3f32df..cfd70bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-26 Hubert Figuiere <hfiguiere@teaser.fr>
+
+ * shell/ev-print-job.c: (idle_print_handler):
+
+ Fix for bug Bug 318916: Printing multiple pages.
+
2005-10-20 Runa Bhattacharjee <runa@bengalinux.org>
* configure.ac: Added "bn" (Bengali) to ALL_LINGUAS.
diff --git a/shell/ev-print-job.c b/shell/ev-print-job.c
index 955e4ba..bb463f9 100644
--- a/shell/ev-print-job.c
+++ b/shell/ev-print-job.c
@@ -48,8 +48,8 @@ struct _EvPrintJob {
double width; /* FIXME unused */
double height; /* FIXME unused */
gboolean duplex; /* FIXME unused */
- int copies; /* FIXME unused */
- int collate; /* FIXME unsued */
+ int copies;
+ int collate;
/* range printing */
int first_page;
@@ -60,6 +60,7 @@ struct _EvPrintJob {
guint idle_id;
gboolean printing;
int next_page;
+ int copies_done;
};
struct _EvPrintJobClass {
@@ -281,9 +282,25 @@ idle_print_handler (EvPrintJob *job)
g_object_unref (rc);
- job->next_page++;
+ if (job->collate) {
+ /* collate must repeat the same page */
+ job->copies_done++;
+ if(job->copies == job->copies_done) {
+ job->next_page++;
+ job->copies_done = 0;
+ }
+ } else {
+ job->next_page++;
+ if (job->next_page > job->last_page){
+ job->copies_done++;
+ if(job->copies_done < job->copies) {
+ /* more copies to go, restart to the first page */
+ job->next_page = job->first_page;
+ }
+ }
+ }
return TRUE;
- } else { /* no more pages */
+ } else { /* no more pages or copies */
ev_document_doc_mutex_lock ();
ev_ps_exporter_end (EV_PS_EXPORTER (job->document));
ev_document_doc_mutex_unlock ();