mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8203499: Uninitialised memory in WinAccessBridge.cpp
Reviewed-by: serb
This commit is contained in:
parent
39f36c179d
commit
24dd5debd4
12 changed files with 599 additions and 211 deletions
|
@ -74,6 +74,7 @@ import javax.print.attribute.Size2DSyntax;
|
|||
import javax.print.attribute.standard.Copies;
|
||||
import javax.print.attribute.standard.Destination;
|
||||
import javax.print.attribute.standard.DialogTypeSelection;
|
||||
import javax.print.attribute.standard.DialogOwner;
|
||||
import javax.print.attribute.standard.Fidelity;
|
||||
import javax.print.attribute.standard.JobName;
|
||||
import javax.print.attribute.standard.JobSheets;
|
||||
|
@ -830,17 +831,24 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
int x = gcBounds.x+50;
|
||||
int y = gcBounds.y+50;
|
||||
ServiceDialog pageDialog;
|
||||
boolean setOnTop = false;
|
||||
if (onTop != null) {
|
||||
attributes.add(onTop);
|
||||
Window owner = onTop.getOwner();
|
||||
if (owner != null) {
|
||||
w = owner; // use the one specifed by the app
|
||||
} else if (DialogOwnerAccessor.getID(onTop) == 0) {
|
||||
setOnTop = true;
|
||||
}
|
||||
}
|
||||
if (w instanceof Frame) {
|
||||
pageDialog = new ServiceDialog(gc, x, y, service,
|
||||
DocFlavor.SERVICE_FORMATTED.PAGEABLE,
|
||||
attributes,(Frame)w);
|
||||
} else {
|
||||
pageDialog = new ServiceDialog(gc, x, y, service,
|
||||
DocFlavor.SERVICE_FORMATTED.PAGEABLE,
|
||||
attributes, (Dialog)w);
|
||||
attributes, w);
|
||||
if (setOnTop) {
|
||||
try {
|
||||
pageDialog.setAlwaysOnTop(true);
|
||||
} catch (SecurityException e) {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle dlgBounds = pageDialog.getBounds();
|
||||
|
@ -988,8 +996,7 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
* (it might be set in java.awt.PrintJob.printDialog)
|
||||
*/
|
||||
if (attributes.get(DialogOwner.class) == null) {
|
||||
attributes.add(w instanceof Frame ? new DialogOwner((Frame)w) :
|
||||
new DialogOwner((Dialog)w));
|
||||
attributes.add(new DialogOwner(w));
|
||||
}
|
||||
} else {
|
||||
grCfg = GraphicsEnvironment.getLocalGraphicsEnvironment().
|
||||
|
@ -2581,7 +2588,7 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
}
|
||||
}
|
||||
|
||||
private DialogOnTop onTop = null;
|
||||
private DialogOwner onTop = null;
|
||||
|
||||
private long parentWindowID = 0L;
|
||||
|
||||
|
@ -2597,9 +2604,9 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
|
||||
private void setParentWindowID(PrintRequestAttributeSet attrs) {
|
||||
parentWindowID = 0L;
|
||||
onTop = (DialogOnTop)attrs.get(DialogOnTop.class);
|
||||
onTop = (DialogOwner)attrs.get(DialogOwner.class);
|
||||
if (onTop != null) {
|
||||
parentWindowID = onTop.getID();
|
||||
parentWindowID = DialogOwnerAccessor.getID(onTop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue