The patch seems to work alright judging by the test-case, except for printing
in reverse where it produces blanks (as it inserts blank pages when the last
"page range to be printed" is reached) Note that if the pages were provided in
the correct order for multipage reverse printing, it would work properly.
Another (very) minor issue is that if one is printing say a 4-page document
with 4 pages per sheet and one chooses to print "even sheets only", a blank
page will be printed. This is a user interface problem as the UI should not
allow "even sheets" to be selected if there are none. (the same is true if you
print "even sheets" in a single-page document at one-page per sheet)