]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 6 Jul 2003 20:02:43 +0000 (20:02 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sun, 6 Jul 2003 20:02:43 +0000 (20:02 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@3786 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
cups/ppd.c
scheduler/banners.c

index ea68ed569be486bd8ec54c9b360f8d84bea335b2..78d5cc061bbcc900801ea1af0bd2c50f6f957b99 100644 (file)
@@ -3,6 +3,11 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.20rc1
 
+       - The ppdOpen functions still supported the
+         VariablePaperSize attribute, which was removed in v4.0
+         of the PPD spec.  This caused problems with PPD files
+         that relocated the PageSize option to a non-standard
+         group (STR #158)
        - The cups.list file referenced MAN1EXT, MAN3EXT, and
          MAN5EXT, but none of those were actually defined (STR
          #147)
index 9aefb2f485d98882a0e4644e3a7bbd899e64e4ea..643550799213859b7fb1240f80da618d5a66d038 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: ppd.c,v 1.51.2.53 2003/06/14 16:19:54 mike Exp $"
+ * "$Id: ppd.c,v 1.51.2.54 2003/07/06 20:02:41 mike Exp $"
  *
  *   PPD file routines for the Common UNIX Printing System (CUPS).
  *
@@ -678,6 +678,8 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
              !strcmp(ppd->attrs[j]->name + 7, keyword) &&
              ppd->attrs[j]->value)
          {
+           DEBUG_printf(("Setting Default%s to %s via attribute...\n",
+                         option->keyword, ppd->attrs[j]->value));
            strlcpy(option->defchoice, ppd->attrs[j]->value,
                    sizeof(option->defchoice));
            break;
@@ -849,95 +851,6 @@ ppdOpen(FILE *fp)                  /* I - File to read from */
       ppd->fonts[ppd->num_fonts] = strdup(name);
       ppd->num_fonts ++;
     }
-    else if (strcmp(keyword, "VariablePaperSize") == 0 &&
-             strcmp(string, "True") == 0 &&
-            !ppd->variable_sizes)
-    {
-      ppd->variable_sizes = 1;
-
-     /*
-      * Add a "Custom" page size entry...
-      */
-
-      ppd_add_size(ppd, "Custom");
-
-     /*
-      * Add a "Custom" page size option...
-      */
-
-      if ((option = ppdFindOption(ppd, "PageSize")) == NULL)
-      {
-        ppd_group_t    *temp;
-
-
-       if ((temp = ppd_get_group(ppd, "General",
-                                  cupsLangString(language,
-                                                 CUPS_MSG_GENERAL))) == NULL)
-       {
-          ppdClose(ppd);
-
-         ppd_free(string);
-
-          cupsLangFree(language);
-
-#ifdef LC_NUMERIC
-          setlocale(LC_NUMERIC, oldlocale);
-#else
-          setlocale(LC_ALL, oldlocale);
-#endif /* LC_NUMERIC */
-
-          ppd_status = PPD_ALLOC_ERROR;
-
-         return (NULL);
-       }
-
-       if ((option = ppd_get_option(temp, "PageSize")) == NULL)
-       {
-          ppdClose(ppd);
-
-         ppd_free(string);
-
-          cupsLangFree(language);
-
-#ifdef LC_NUMERIC
-          setlocale(LC_NUMERIC, oldlocale);
-#else
-          setlocale(LC_ALL, oldlocale);
-#endif /* LC_NUMERIC */
-
-          ppd_status = PPD_ALLOC_ERROR;
-
-         return (NULL);
-       }
-      }
-
-      if ((choice = ppd_add_choice(option, "Custom")) == NULL)
-      {
-        ppdClose(ppd);
-
-       ppd_free(string);
-
-        cupsLangFree(language);
-
-#ifdef LC_NUMERIC
-        setlocale(LC_NUMERIC, oldlocale);
-#else
-        setlocale(LC_ALL, oldlocale);
-#endif /* LC_NUMERIC */
-
-        ppd_status = PPD_ALLOC_ERROR;
-
-       return (NULL);
-      }
-
-      strlcpy(choice->text, cupsLangString(language, CUPS_MSG_VARIABLE),
-              sizeof(choice->text));
-      option = NULL;
-    }
-    else if (strcmp(keyword, "MaxMediaWidth") == 0)
-      ppd->custom_max[0] = (float)atof(string);
-    else if (strcmp(keyword, "MaxMediaHeight") == 0)
-      ppd->custom_max[1] = (float)atof(string);
     else if (strcmp(keyword, "ParamCustomPageSize") == 0)
     {
       if (strcmp(name, "Width") == 0)
@@ -954,6 +867,8 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
     else if (strcmp(keyword, "CustomPageSize") == 0 &&
              strcmp(name, "True") == 0)
     {
+      DEBUG_puts("Processing CustomPageSize...");
+
       if (!ppd->variable_sizes)
       {
        ppd->variable_sizes = 1;
@@ -973,6 +888,8 @@ ppdOpen(FILE *fp)                   /* I - File to read from */
          ppd_group_t   *temp;
 
 
+          DEBUG_puts("PageSize option not found for CustomPageSize...");
+
          if ((temp = ppd_get_group(ppd, "General",
                                     cupsLangString(language,
                                                    CUPS_MSG_GENERAL))) == NULL)
@@ -1087,8 +1004,7 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
       }
 
       choice->code = string;
-      string = NULL;
-      option = NULL;
+      option       = NULL;
     }
     else if (strcmp(keyword, "LandscapeOrientation") == 0)
     {
@@ -1311,6 +1227,8 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
            !strcmp(ppd->attrs[j]->name + 7, name) &&
            ppd->attrs[j]->value)
        {
+         DEBUG_printf(("Setting Default%s to %s via attribute...\n",
+                       option->keyword, ppd->attrs[j]->value));
          strlcpy(option->defchoice, ppd->attrs[j]->value,
                  sizeof(option->defchoice));
          break;
@@ -1459,6 +1377,8 @@ ppdOpen(FILE *fp)                 /* I - File to read from */
            !strcmp(ppd->attrs[j]->name + 7, name) &&
            ppd->attrs[j]->value)
        {
+         DEBUG_printf(("Setting Default%s to %s via attribute...\n",
+                       option->keyword, ppd->attrs[j]->value));
          strlcpy(option->defchoice, ppd->attrs[j]->value,
                  sizeof(option->defchoice));
          break;
@@ -1666,7 +1586,11 @@ ppdOpen(FILE *fp)                        /* I - File to read from */
         * Set the default as part of the current option...
        */
 
+        DEBUG_printf(("Setting %s to %s...\n", keyword, string));
+
         strlcpy(option->defchoice, string, sizeof(option->defchoice));
+
+        DEBUG_printf(("%s is now %s...\n", keyword, option->defchoice));
       }
       else
       {
@@ -1678,7 +1602,10 @@ ppdOpen(FILE *fp)                        /* I - File to read from */
 
 
         if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL)
+       {
+         DEBUG_printf(("Setting %s to %s...\n", keyword, string));
          strlcpy(toption->defchoice, string, sizeof(toption->defchoice));
+       }
       }
     }
     else if (strcmp(keyword, "UIConstraints") == 0 ||
@@ -2832,6 +2759,9 @@ ppd_get_option(ppd_group_t *group,        /* I - Group */
   ppd_option_t *option;                /* Option */
 
 
+  DEBUG_printf(("ppd_get_option(group=%p(\"%s\"), name=\"%s\")\n",
+                group, group->name, name));
+
   for (i = group->num_options, option = group->options; i > 0; i --, option ++)
     if (strcmp(option->keyword, name) == 0)
       break;
@@ -3281,5 +3211,5 @@ ppd_read(FILE *fp,                        /* I - File to read from */
 
 
 /*
- * End of "$Id: ppd.c,v 1.51.2.53 2003/06/14 16:19:54 mike Exp $".
+ * End of "$Id: ppd.c,v 1.51.2.54 2003/07/06 20:02:41 mike Exp $".
  */
index ac7b9feb07b0877634767a08963c43d59d144bdc..eb5980f8586c810c481db4f96cd9567a65096d1a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: banners.c,v 1.5.2.5 2003/03/30 21:49:15 mike Exp $"
+ * "$Id: banners.c,v 1.5.2.6 2003/07/06 20:02:43 mike Exp $"
  *
  *   Banner routines for the Common UNIX Printing System (CUPS).
  *
@@ -162,7 +162,7 @@ LoadBanners(const char *d)  /* I - Directory to search */
 
     if (stat(filename, &fileinfo))
     {
-      LogMessage(L_WARN, "LoadBanners: Unable to state \"%s\" banner: %s",
+      LogMessage(L_WARN, "LoadBanners: Unable to stat \"%s\" banner: %s",
                  dent->d_name, strerror(errno));
       continue;
     }
@@ -211,5 +211,5 @@ compare(const banner_t *b0, /* I - First banner */
 
 
 /*
- * End of "$Id: banners.c,v 1.5.2.5 2003/03/30 21:49:15 mike Exp $".
+ * End of "$Id: banners.c,v 1.5.2.6 2003/07/06 20:02:43 mike Exp $".
  */