On Mon, 17 Jun 2024 05:54:37 GMT, Renjith Kannath Pariyangad <rkannathp...@openjdk.org> wrote:
> Hi Reviewers, > > This fix will resolve page range not printing proper pages if the rage begin > from 2 or above on Mac machines. > I have verified the manual range related tests like PageRanges.java, > ClippedImages.java and test.java and confirmed its fixing the issue. > > Please review and let me know your suggestions if any. Is it possible to write an automated test which prints to a file? It would reduce the effort for testing if the expected range of pages is printed. Do you refer to [`test/jdk/java/awt/print/PrinterJob/PageRanges.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/PrinterJob/PageRanges.java) and [`test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java)? Is `Test.java` the test case attached to [JDK-8297191](https://bugs.openjdk.org/browse/JDK-8297191)? I couldn't test with `ClippedImages.java`, I didn't find a way to print to PDF. I used `PageRanges.java`; this test cannot be run as a jtreg test, but it works as a stand-alone app that can be run directly. It is relatively more convenient this way, the test needs to be updated, it is part of [JDK-8320677](https://bugs.openjdk.org/browse/JDK-8320677). You should add 8297191 to the list of bugids to the tests that you're using to verify this fix. I also noticed that after I apply your patch, the Print dialog preserves the previously selected range. I mean if I select pages 2 to 3 when the Print dialog is shown for the first time, the dialog comes up with Range from 2 to 3 selected when it's shown for the second time. Without the patch, the dialog has no selection (neither All Pages nor Range is selected) when it's shown for the first time. As far as I can see, there were two bugs which added support for page ranges on macOS: [JDK-7183520](https://bugs.openjdk.org/browse/JDK-7183520) and [JDK-8042713](https://bugs.openjdk.org/browse/JDK-8042713). ------------- PR Review: https://git.openjdk.org/jdk/pull/19740#pullrequestreview-2131074084