提交 b16748ae 编写于 作者: A asaha

8132988: Better printing dialogues

Reviewed-by: van, vadim
Contributed-by: nakul.natu@oracle.com
上级 e7c4c6d7
/*
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -234,6 +234,11 @@ public final class CPrinterJob extends RasterPrinterJob {
// this will not work if the user clicks on the "Preview" button
// However if the printer is a StreamPrintService, its the right path.
PrintService psvc = getPrintService();
if (psvc == null) {
throw new PrinterException("No print service found.");
}
if (psvc instanceof StreamPrintService) {
spoolToService(psvc, attributes);
return;
......@@ -775,4 +780,4 @@ public final class CPrinterJob extends RasterPrinterJob {
(float) (paper.getImageableHeight() / dpi),
MediaPrintableArea.INCH);
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册