From: Michael R Sweet Date: Fri, 7 Jul 2017 20:12:11 +0000 (-0400) Subject: The IPP backend now always sends the "finishings" attribute for printers that X-Git-Tag: v2.2.5~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e44bdfe7e3a805e36ee08846e8e2c5a8170ecb0b;p=thirdparty%2Fcups.git The IPP backend now always sends the "finishings" attribute for printers that support it because otherwise the client cannot override printer defaults (rdar://33169732) --- diff --git a/CHANGES.md b/CHANGES.md index bb895d49fa..fd03ddf4cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 7e40214da2..f41b4387d1 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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);