]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The IPP backend now always sends the "finishings" attribute for printers that
authorMichael R Sweet <michaelrsweet@gmail.com>
Fri, 7 Jul 2017 20:12:11 +0000 (16:12 -0400)
committerMichael R Sweet <michaelrsweet@gmail.com>
Fri, 7 Jul 2017 20:12:11 +0000 (16:12 -0400)
support it because otherwise the client cannot override printer defaults
(rdar://33169732)

CHANGES.md
cups/ppd-cache.c

index bb895d49faac716d188db7e309ef462d8cf776cd..fd03ddf4cc5d275cd4f5c3b721b57461bc22613d 100644 (file)
@@ -9,6 +9,9 @@ CHANGES IN CUPS V2.2.5
 - The `cupsGetDests` function incorrectly returned an empty list of printers if
   there was no default printer (Issue #5046)
 - Fixed an issue with Chinese localizations on macOS (rdar://32419311)
+- The IPP backend now always sends the "finishings" attribute for printers that
+  support it because otherwise the client cannot override printer defaults
+  (rdar://33169732)
 
 
 CHANGES IN CUPS V2.2.4
index 7e40214da2062b75f19cca117f49e90a54bbf882..f41b4387d1c74a0f170e341b01d7c75d4f13059d 100644 (file)
@@ -2084,11 +2084,16 @@ _ppdCacheGetFinishingValues(
 
   DEBUG_printf(("_ppdCacheGetFinishingValues(pc=%p, num_options=%d, options=%p, max_values=%d, values=%p)", pc, num_options, options, max_values, values));
 
-  if (!pc || !pc->finishings || num_options < 1 || max_values < 1 || !values)
+  if (!pc || max_values < 1 || !values)
   {
     DEBUG_puts("_ppdCacheGetFinishingValues: Bad arguments, returning 0.");
     return (0);
   }
+  else if (!pc->finishings)
+  {
+    DEBUG_puts("_ppdCacheGetFinishingValues: No finishings support, returning 0.");
+    return (0);
+  }
 
  /*
   * Go through the finishings options and see what is set...
@@ -2114,7 +2119,7 @@ _ppdCacheGetFinishingValues(
 
     if (i == 0)
     {
-      DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d.", f->value));
+      DEBUG_printf(("_ppdCacheGetFinishingValues: Adding %d (%s)", f->value, ippEnumString("finishings", f->value)));
 
       values[num_values ++] = f->value;
 
@@ -2123,6 +2128,17 @@ _ppdCacheGetFinishingValues(
     }
   }
 
+  if (num_values == 0)
+  {
+   /*
+    * Always have at least "finishings" = 'none'...
+    */
+
+    DEBUG_puts("_ppdCacheGetFinishingValues: Adding 3 (none).");
+    values[0] = IPP_FINISHINGS_NONE;
+    num_values ++;
+  }
+
   DEBUG_printf(("_ppdCacheGetFinishingValues: Returning %d.", num_values));
 
   return (num_values);