From: Till Kamppeter Date: Wed, 1 Sep 2021 13:08:23 +0000 (+0200) Subject: Fixed bugs revealed by LGTM.com X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14f3883b1f0af0849fa84757d44169d39f4062ac;p=thirdparty%2Fcups.git Fixed bugs revealed by LGTM.com This especially revealed that on selecting the final setting for the color mode/quality presets only 2 of the intended 3 passes were done. --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 2d65109198..a31d9371bd 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -2544,8 +2544,6 @@ _ppdCacheAssignPresets(ppd_file_t *ppd, /* No or small change -> Normal quality */ if (m == 1) properties->sets_normal += res_factor * 4; - else if (m > 1 && m < 2) - properties->sets_normal += res_factor * 2; /* At least double the pixels -> High quality */ else if (m == 2) properties->sets_high += res_factor * 3; @@ -2563,8 +2561,6 @@ _ppdCacheAssignPresets(ppd_file_t *ppd, /* No or small change -> Normal quality */ if (m == 1) properties->sets_normal += res_factor * 1; - else if (m > 1 && m < 2) - properties->sets_normal += res_factor * 1; /* At most half the pixels -> Draft quality */ else if (m == 2) properties->sets_draft += res_factor * 3; @@ -2591,7 +2587,7 @@ _ppdCacheAssignPresets(ppd_file_t *ppd, * grid */ - for (pass = 0; pass < 2; pass ++) + for (pass = 0; pass < 3; pass ++) { for (k = 0; k < option->num_choices; k ++) {