Repository navigation
BUG: Reject a non-positive number of copies - #4012
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
stefan6419846
left a comment
There was a problem hiding this comment.
Why is 0 no valid value here?
f17ab9d to
2983d9e
Compare
|
No good reason, you're right. The spec gives no lower bound for /NumCopies, only a typical default of one, so a reader that sees 0 falls back to its own default - and set_page_label already treats a start of 0 as "not set" rather than refusing it. Narrowed to negatives only, which is the part a reader genuinely cannot interpret. Rebased at the same time since this one had the same test-file conflict. |
|
We have the next conflict after the last merge. |
2983d9e to
241f98d
Compare
/NumCopies was written through without a check, so a negative value was stored just as readily as a real count and no reader can interpret it. Zero stays allowed: the spec gives no lower bound, only a typical default of one, so a reader that sees it falls back to its own default. set_page_label treats a start of zero the same way.
241f98d to
e0b000f
Compare
/NumCopiesis written through without a check:So a document can ask a viewer to print no copies, or a negative number of them.
The name-valued preferences beside it already refuse a value outside their allowed set and report it the same way, so this uses the same message shape.
_set_intbacks onlynum_copies, so nothing else is affected.Reverting the change fails the three new tests