|
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
|