[OpenJDK 2D-Dev] [9] RFR JDK-8042713, , [macosx] Print dialog does not update attribute set with page range

Phil Race philip.race at oracle.com
Fri Mar 18 19:21:08 UTC 2016

The bug report seems to be lacking a proper (any) evaluation.

It is probably not accurate to say it did not call the "correct" methods 
the problem is actually that there was no method that did this and you 
to add them and make sure they also did what they in turn called what native
had been calling after setting the attribute.

The change itself seems to be mimicing what happens in Windows printing 
ie WPrinterJob.setRangeCopiesAttribute(..) ?

Is this intentional ? If so that would have been useful to point out so 
I did not
need to hunt it down. Looking at that code I see that is does a couple of
other things (1) has a way of indicating an explicitly set number of copies
vs default copies, (2) accepts a boolean indicating if in the dialog a range
was actually requested. It looks like in the OSX code we only make the 
in that case, but I need you to verify that all this works as it is 
supposed to.

Also native used to use a zero-based index and you have changed that without
commenting on it. First it is still zero-based in the initialisation and 
may not
always be changed. Secondly if you want 1-based then you seem to have
a problem as the new Java method calls

setPageRange(from, to);

with the 1-based values and that seems to be the method which accepted 
the zero-based values.
This seems very fishy.


On 03/18/2016 02:02 AM, prasanta sadhukhan wrote:
> Hi Phil,
> Please review a fix for
> bug: https://bugs.openjdk.java.net/browse/JDK-8042713
> webrev: http://cr.openjdk.java.net/~psadhukhan/8042713/webrev.00/
> The OS X platform print dialog has an option to set the page ranges.
> If this is done it ought to be reported back in the AttributeSet.
> but it was found that the page range attribute is not reported back .
> This is because nsPrintInfoToJavaPrinterJob() does not call correct 
> Java setxxxAttributes methods to set the attributes.
> I added the corresponding setPageRangeAttribute method along with 
> setCopiesAttribute method to report back the "page range" and "copies" 
> in AttributeSet.
> Regards
> Prasanta

More information about the 2d-dev mailing list