From: Michael R Sweet Date: Wed, 2 Apr 2025 19:22:39 +0000 (-0400) Subject: Allow media to override PageSize, InputSlot, and MediaType (Issue #1125) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d5a3de24724759c24b70649009efc6c0b373ae2;p=thirdparty%2Fcups.git Allow media to override PageSize, InputSlot, and MediaType (Issue #1125) --- diff --git a/cups/ppd-mark.c b/cups/ppd-mark.c index 866991293f..219136f6a9 100644 --- a/cups/ppd-mark.c +++ b/cups/ppd-mark.c @@ -127,21 +127,15 @@ cupsMarkOptions( * Mark it... */ - if (!page_size || !page_size[0]) - { - if (!_cups_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s)) - ppd_mark_option(ppd, "PageSize", s); - else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL) - ppd_mark_option(ppd, "PageSize", ppd_keyword); - } + if (!_cups_strncasecmp(s, "Custom.", 7) || ppdPageSize(ppd, s)) + ppd_mark_option(ppd, "PageSize", s); + else if ((ppd_keyword = _ppdCacheGetPageSize(cache, NULL, s, NULL)) != NULL) + ppd_mark_option(ppd, "PageSize", ppd_keyword); - if (cache && cache->source_option && - !cupsGetOption(cache->source_option, num_options, options) && - (ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL) + if (cache && cache->source_option && (ppd_keyword = _ppdCacheGetInputSlot(cache, NULL, s)) != NULL) ppd_mark_option(ppd, cache->source_option, ppd_keyword); - if (!cupsGetOption("MediaType", num_options, options) && - (ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL) + if ((ppd_keyword = _ppdCacheGetMediaType(cache, NULL, s)) != NULL) ppd_mark_option(ppd, "MediaType", ppd_keyword); } }