Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6594374
Votes 0
Synopsis Unnecessary orientation re-setting in windows print data structures.
Category java:classes_2d
Reported Against
Release Fixed 7(b20)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6588006
Submit Date 17-AUG-2007
Description
In a recent fix
6588006: windows implementation of java.awt.print.PrinterJob needs to better sync java and native

I added setDeviceOrientation into awt_PrintJob.cpp.
Since we always force "portait" mode, during printing
this restores device orientation in the DEVMODE.

However I realise this is rarely useful, in fact unnecessary, and even harmful.

Its rarely useful since most PrinterJob's are used once and discarded,
restoring its state would only be of interest to an app that re-used
the PrinterJob.

However its unncessary in that case since, if printing, we want
it in portrait mode still, and if displaying the page or print dialog,
we always copy the PageFormat state down into native to set up the
dialog anyway.

Finally, its harmful right now due to a bug where "mAttOrientation"
in WPrinterJob is initialised to "0" which is not a legal GDI value
for this, and it is never updated. So restoring it to "0" is wrong,
and looks like it causes ::ResetDC(hdc, devmode) to claim it
succeeeded but in fact leak a GDI  customer .

Updating "mAttOrientation" to have the correct value is possible,
but given the previous observations, I think its simplest to just
do away with mAttOrientation.
We sync the native state into the attribute set when using the PageDialog,
and the PrintDialog, and then use that value as the basis for
setting them up again for subsequent displays of the dialog.
Posted Date : 2007-08-17 18:14:35.0
Work Around
N/A
Evaluation
As per description
Posted Date : 2007-08-17 18:14:35.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang