|
1 | 1 | // |
2 | 2 | // IPP Everywhere printer application for CUPS. |
3 | 3 | // |
4 | | -// Copyright © 2021-2022 by OpenPrinting. |
| 4 | +// Copyright © 2021-2023 by OpenPrinting. |
5 | 5 | // Copyright © 2020 by the IEEE-ISTO Printer Working Group. |
6 | 6 | // Copyright © 2010-2021 by Apple Inc. |
7 | 7 | // |
@@ -7760,11 +7760,34 @@ valid_job_attributes( |
7760 | 7760 |
|
7761 | 7761 | for (i = 0; i < count ; i ++) |
7762 | 7762 | { |
| 7763 | + int x_min, x_max; // Min/max width |
| 7764 | + int y_min, y_max; // Min/max length |
| 7765 | + |
7763 | 7766 | size = ippGetCollection(supported, i); |
7764 | 7767 | x_dim = ippFindAttribute(size, "x-dimension", IPP_TAG_ZERO); |
7765 | 7768 | y_dim = ippFindAttribute(size, "y-dimension", IPP_TAG_ZERO); |
7766 | 7769 |
|
7767 | | - if (ippContainsInteger(x_dim, x_value) && ippContainsInteger(y_dim, y_value)) |
| 7770 | + if (ippGetValueTag(x_dim) == IPP_TAG_INTEGER) |
| 7771 | + { |
| 7772 | + x_min = ippGetInteger(x_dim, 0) - 100; |
| 7773 | + x_max = ippGetInteger(x_dim, 0) + 100; |
| 7774 | + } |
| 7775 | + else |
| 7776 | + { |
| 7777 | + x_min = ippGetRange(x_dim, 0, &x_max); |
| 7778 | + } |
| 7779 | + |
| 7780 | + if (ippGetValueTag(y_dim) == IPP_TAG_INTEGER) |
| 7781 | + { |
| 7782 | + y_min = ippGetInteger(y_dim, 0) - 100; |
| 7783 | + y_max = ippGetInteger(y_dim, 0) + 100; |
| 7784 | + } |
| 7785 | + else |
| 7786 | + { |
| 7787 | + y_min = ippGetRange(y_dim, 0, &x_max); |
| 7788 | + } |
| 7789 | + |
| 7790 | + if ((x_value < x_min || x_value > x_max) && (y_value < y_min || y_value > y_max)) |
7768 | 7791 | break; |
7769 | 7792 | } |
7770 | 7793 |
|
|
0 commit comments