]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libppd: In IPP-attr-to-PPD-option auto mapper consider "ColorMode" also with prefix
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 15 Sep 2021 18:51:02 +0000 (20:51 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 15 Sep 2021 18:51:02 +0000 (20:51 +0200)
This way we also cover "cupsColorMode" for example which appears in
auto-generated PPDs for driverless IPP printers (in case we cannot
print directly to the printer but only have access via a CUPS queue).

ppd/ppd-cache.c

index 41df2a32250b9b65f6bdbe4d3fcfdac98d999863..b8a1c265af2532e3fba8738d6910d2e95b43376c 100644 (file)
@@ -2233,7 +2233,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
        }
 
        /*
-       * Color/Gray - print-color-mode
+       * Color/Monochrome - print-color-mode
        */
 
        /* If we have a color device, check whether this option sets mono or
@@ -2257,7 +2257,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
              properties->sets_color = 1;
          }
          else if (strcasecmp(o, "ColorModel") == 0 ||
-                  strcasecmp(o, "ColorMode") == 0 ||
+                  strcasestr(o, "ColorMode") ||
                   strcasecmp(o, "OutputMode") == 0 ||
                   strcasecmp(o, "PrintoutMode") == 0 ||
                   strcasecmp(o, "ARCMode") == 0 || /* Sharp */
@@ -2394,7 +2394,7 @@ ppdCacheAssignPresets(ppd_file_t *ppd,
        }
        /* Generic enumerated choice option and choice names */
        else if (strcasecmp(o, "ColorModel") == 0 ||
-                strcasecmp(o, "ColorMode") == 0 ||
+                strcasestr(o, "ColorMode") ||
                 strcasecmp(o, "OutputMode") == 0 || /* HPLIP hpcups */
                 strcasecmp(o, "PrintoutMode") == 0 || /* Foomatic */
                 strcasecmp(o, "PrintQuality") == 0 ||