[OpenJDK 2D-Dev]  RFR: JDK-8061258, , [macosx] PrinterJob's native Print Dialog does not reflect specified Copies or Page Ranges
prasanta.sadhukhan at oracle.com
Wed Mar 23 11:02:35 UTC 2016
Please review a fix for jdk9
When user attempts to pre-populate the native dialog with copies and
page ranges by calling
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
the print dialog does not reflect the user-defined setting.
This is because osx native code was calling getNumberOfPages() from
OpenBook.java which was returning UNKNOWN_NUMBER_OF_PAGES (-1).
Since getNumberOfPages() returned -1, osx always selected
NSPrintAllPages or All Radio button.
I fixed it by removing this call to getNumberOfPages() and rely on
getMinPage/getMaxPage() as was done in windows
(awt_PrintControl.cpp:AwtPrintControl::InitPrintDialog) to select which
radio button to be selected.
If fromPage > minPage or toPage < maxPage, it means user has selected
page ranges so PageRange radio button is to be selected else "All" radio
button to be selected.
More information about the 2d-dev