mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8039412: Stack overflow on Linux using DialogTypeSelection.NATIVE
Reviewed-by: prr, rchamyal
This commit is contained in:
parent
1e176777db
commit
73b1044258
2 changed files with 66 additions and 1 deletions
|
@ -740,7 +740,19 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
}
|
||||
updatePageAttributes(service, page);
|
||||
|
||||
PageFormat newPage = pageDialog(attributes);
|
||||
PageFormat newPage = null;
|
||||
DialogTypeSelection dts =
|
||||
(DialogTypeSelection)attributes.get(DialogTypeSelection.class);
|
||||
if (dts == DialogTypeSelection.NATIVE) {
|
||||
// Remove DialogTypeSelection.NATIVE to prevent infinite loop in
|
||||
// RasterPrinterJob.
|
||||
attributes.remove(DialogTypeSelection.class);
|
||||
newPage = pageDialog(attributes);
|
||||
// restore attribute
|
||||
attributes.add(DialogTypeSelection.NATIVE);
|
||||
} else {
|
||||
newPage = pageDialog(attributes);
|
||||
}
|
||||
|
||||
if (newPage == null) {
|
||||
return page;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue