]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fixed bugs revealed by LGTM.com
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 1 Sep 2021 13:08:23 +0000 (15:08 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 1 Sep 2021 13:08:23 +0000 (15:08 +0200)
This especially revealed that on selecting the final setting for the
color mode/quality presets only 2 of the intended 3 passes were done.

cups/ppd-cache.c

index 2d65109198d2f9b961d310193b04a035579ee0a5..a31d9371bd4483b316b389208580c5c1cc7d2d40 100644 (file)
@@ -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 ++)
         {