mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8067059: PrinterJob.pageDialog() with DialogSelectionType.NATIVE returns a PageFormat when cancelled
Reviewed-by: jgodinez, prr
This commit is contained in:
parent
73b1044258
commit
18cd974bce
2 changed files with 74 additions and 2 deletions
|
@ -778,8 +778,15 @@ public abstract class RasterPrinterJob extends PrinterJob {
|
|||
// Check for native, note that default dialog is COMMON.
|
||||
if (dlg == DialogTypeSelection.NATIVE) {
|
||||
PrintService pservice = getPrintService();
|
||||
PageFormat page = pageDialog(attributeToPageFormat(pservice,
|
||||
attributes));
|
||||
PageFormat pageFrmAttrib = attributeToPageFormat(pservice,
|
||||
attributes);
|
||||
PageFormat page = pageDialog(pageFrmAttrib);
|
||||
|
||||
// If user cancels the dialog, pageDialog() will return the original
|
||||
// page object and as per spec, we should return null in that case.
|
||||
if (page == pageFrmAttrib) {
|
||||
return null;
|
||||
}
|
||||
updateAttributesWithPageFormat(pservice, page, attributes);
|
||||
return page;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue