]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Support enum keywords (Issue #734)
authorMichael R Sweet <msweet@msweet.org>
Fri, 5 Apr 2024 21:00:45 +0000 (17:00 -0400)
committerMichael R Sweet <msweet@msweet.org>
Fri, 5 Apr 2024 21:00:45 +0000 (17:00 -0400)
CHANGES.md
cups/encode.c

index 24b250f14e7cd0ed43b5b94a09dad39bdf2ecd1c..13226c3f1e3b4e8aae6a65bc2b453f48f5cb38fb 100644 (file)
@@ -25,6 +25,8 @@ Changes in CUPS v2.5b1 (TBA)
 - Updated IPP Everywhere printer creation error reporting (Issue #347)
 - Updated internal usage of CUPS array API to include callback pointer even when
   not used (Issue #674)
+- Updated support for using keyword equivalents for enumerated values like
+  "print-quality" (Issue #734)
 - Updated `cups_enum_dests()` timeout for listing available IPP printers
   (Issue #751)
 - Updated default destination documentation (Issue #819)
index 2e85bc8bf5899baa7607c330f21cc9895d7d871f..703cfe854dc2077c386194d0ea667c923e21cee1 100644 (file)
@@ -546,8 +546,15 @@ _cupsEncodeOption(
 
     switch (attr->value_tag)
     {
-      case IPP_TAG_INTEGER :
       case IPP_TAG_ENUM :
+          if (isalpha(*val & 255))
+          {
+            // Map enum keyword to integer value...
+            ippSetInteger(ipp, &attr, i, ippEnumValue(name, val));
+            break;
+         }
+
+      case IPP_TAG_INTEGER :
         /*
          * Integer/enumeration value...
          */