]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Allow media to override PageSize, InputSlot, and MediaType (Issue #1125)
authorMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 19:22:39 +0000 (15:22 -0400)
committerMichael R Sweet <msweet@msweet.org>
Wed, 2 Apr 2025 19:22:39 +0000 (15:22 -0400)
cups/ppd-mark.c

index 866991293f21255e44326eac5c219b4e4f8f687d..219136f6a93baf6446a08dc9d33ce8f5d17820fa 100644 (file)
@@ -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);
     }
   }