From: Michael R Sweet Date: Wed, 12 Nov 2025 18:53:36 +0000 (-0500) Subject: Don't use custom prefix for non-standard sizes - use oe or om (Issue #1388) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36a8750fe107c51393cc26cba7d9c0f4f56d7fab;p=thirdparty%2Fcups.git Don't use custom prefix for non-standard sizes - use oe or om (Issue #1388) --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 4f88892e64..a5fce7808a 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -2852,13 +2852,13 @@ _ppdCacheGetSize( return (NULL); } + pwgFormatSizeName(pc->custom_pwg_size, sizeof(pc->custom_pwg_size), "custom", /*name*/NULL, (int)w, (int)l, /*units*/NULL); + pc->custom_size.map.ppd = (char *)page_size; + pc->custom_size.map.pwg = pc->custom_pwg_size; pc->custom_size.width = (int)w; pc->custom_size.length = (int)l; - if ((media = pwgMediaForSize((int)w, (int)l)) != NULL) - pc->custom_size.map.pwg = (char *)media->pwg; - return (&(pc->custom_size)); } diff --git a/cups/ppd-private.h b/cups/ppd-private.h index 2a0e778359..4d289b1792 100644 --- a/cups/ppd-private.h +++ b/cups/ppd-private.h @@ -1,7 +1,7 @@ /* * Private PPD definitions for CUPS. * - * Copyright © 2020-2024 by OpenPrinting. + * Copyright © 2020-2025 by OpenPrinting. * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * @@ -109,7 +109,8 @@ struct _ppd_cache_s /**** PPD cache and PWG conversion data ****/ custom_min_length; /* Minimum custom length in 2540ths */ char *custom_max_keyword, /* Maximum custom size PWG keyword */ *custom_min_keyword, /* Minimum custom size PWG keyword */ - custom_ppd_size[41]; /* Custom PPD size name */ + custom_ppd_size[41], /* Custom PPD size name */ + custom_pwg_size[128]; /* Custom PWG size name */ pwg_size_t custom_size; /* Custom size record */ char *source_option; /* PPD option for media source */ int num_sources; /* Number of media sources */ diff --git a/cups/pwg-media.c b/cups/pwg-media.c index a2b49169b1..bfa192354e 100644 --- a/cups/pwg-media.c +++ b/cups/pwg-media.c @@ -1021,11 +1021,11 @@ _pwgMediaNearSize(pwg_media_t *pwg, /* I - Media buffer */ /* * Not a standard size; convert it to a PWG custom name of the form: * - * custom_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu + * [oe|om]_WIDTHxHEIGHTuu_WIDTHxHEIGHTuu */ if (keyword) - pwgFormatSizeName(keyword, keysize, "custom", NULL, width, length, NULL); + pwgFormatSizeName(keyword, keysize, /*prefix*/NULL, NULL, width, length, NULL); if (ppdname) {