On Fri, 18 Jul 2025 13:19:10 GMT, Christian Heilmann <[email protected]> wrote:

>> This PR fixes a bug that caused no or the wrong set of pages to be printed 
>> when using page ranges on macOS.
>> 
>> The main fix is to change the 'location' value of the returned NSRange from 
>> the knowsPageRange method to 1 in the native class PrinterView.m.
>
> Christian Heilmann has updated the pull request with a new target base due to 
> a merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains five additional 
> commits since the last revision:
> 
>  - 8297191 fixed printing page range for e.g. page 2 to 2 on macOS
>  - 8297191 fixed printing page range for e.g. page 2 to 2 on macOS
>  - Merge branch 'master' of https://github.com/openjdk/jdk into pr/11266
>  - Merge branch 'master' into pr/11266
>  - 8297191 fixed printing page range for e.g. page 2 to 2 on macOS

Test precondition providing 5 pages.
I tested **successfully** the following with native print dialog and swing 
(common) print dialog:

**Test with native (DialogTypeSelection.NATIVE) print dialog**
|Pageable.getNumberOfPages|PrintRequestAttributeSet|manual enter range in print 
dialog|printed pages|
|---|---|---|---|
|5|-|all pages|1 - 5|
|5|-|1 - 5|1 - 5|
|5|-|1 - 1|1|
|5|-|5 - 5|5|
|5|-|2 - 4|2 - 4|
|5|PageRanges(3, 5)|-|3 - 5|
|5|PageRanges(3, 5)|all pages|1 - 5|
|5|PageRanges(3, 5)|1 - 5|1 - 5|
|5|PageRanges(5, 5)|-|5|
|UNKNOWN_NUMBER_OF_PAGES|-|all pages|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|-|1 - 5|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|PageRanges(3, 5)|all pages|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|PageRanges(3, 5)|1 - 5|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|PageRanges(3, 5)|2 - 2|2|

**Test with Swing (DialogTypeSelection.COMMON) print dialog**
|Pageable.getNumberOfPages|PrintRequestAttributeSet|manual enter range in print 
dialog|printed pages|
|---|---|---|---|
|5|-|all pages|1 - 5|
|5|-|1 - 5|1 - 5|
|5|-|1 - 1|1|
|5|-|5 - 5|5|
|5|-|2 - 4|2 - 4|
|5|PageRanges(3, 5)|-|3 - 5|
|5|PageRanges(3, 5)|all pages|1 - 5|
|5|PageRanges(3, 5)|1 - 5|1 - 5|
|5|PageRanges(5, 5)|-|5|
|UNKNOWN_NUMBER_OF_PAGES|-|all pages|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|-|1 - 5|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|PageRanges(3, 5)|all pages|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|PageRanges(3, 5)|1 - 5|1 - 5|
|UNKNOWN_NUMBER_OF_PAGES|PageRanges(3, 5)|2 - 2|2|

-------------

PR Comment: https://git.openjdk.org/jdk/pull/11266#issuecomment-3415745572

Reply via email to