]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/emit.c
Copyright updates...
[thirdparty/cups.git] / cups / emit.c
index ebb6a2a2bc39bbb5abea2044dd7f8856dc81100a..4353bfd8a58a5ae952a60583416d87cfaebf3a48 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: emit.c,v 1.35 2003/06/02 20:24:00 mike Exp $"
+ * "$Id: emit.c,v 1.39 2004/02/25 20:14:51 mike Exp $"
  *
  *   PPD code emission routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2003 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2004 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -257,6 +257,8 @@ ppdEmit(ppd_file_t    *ppd,         /* I - PPD file record */
            pos = 4;
          else
          {
+           pos --;
+
             if (pos < 0 || pos > 4)
              pos = 4;
 
@@ -456,6 +458,8 @@ ppdEmitFd(ppd_file_t    *ppd,               /* I - PPD file record */
            pos = 4;
          else
          {
+           pos --;
+
             if (pos < 0 || pos > 4)
              pos = 4;
 
@@ -622,10 +626,10 @@ ppdEmitJCL(ppd_file_t *ppd,               /* I - PPD file record */
             job_id, user, temp);
   }
   else
-    fputs(ppd->jcl_begin, stdout);
+    fputs(ppd->jcl_begin, fp);
 
-  ppdEmit(ppd, stdout, PPD_ORDER_JCL);
-  fputs(ppd->jcl_ps, stdout);
+  ppdEmit(ppd, fp, PPD_ORDER_JCL);
+  fputs(ppd->jcl_ps, fp);
 
   return (0);
 }
@@ -687,8 +691,14 @@ ppd_handle_media(ppd_file_t *ppd)
 
     ppdMarkOption(ppd, "PageRegion", size->name);
 
-    if ((rpr && rpr->value && !strcmp(rpr->value, "False")) ||
-        (!rpr && !ppd->num_filters))
+   /*
+    * RequiresPageRegion does not apply to manual feed so we need to
+    * check that we are not doing manual feed before unmarking PageRegion.
+    */
+
+    if (!(manual_feed && !strcasecmp(manual_feed->choice, "True")) &&
+        ((rpr && rpr->value && !strcmp(rpr->value, "False")) ||
+         (!rpr && !ppd->num_filters)))
     {
      /*
       * Either the PPD file specifies no PageRegion code or the PPD file
@@ -724,5 +734,5 @@ ppd_sort(ppd_choice_t **c1, /* I - First choice */
 
 
 /*
- * End of "$Id: emit.c,v 1.35 2003/06/02 20:24:00 mike Exp $".
+ * End of "$Id: emit.c,v 1.39 2004/02/25 20:14:51 mike Exp $".
  */