Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
1442cdad
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1442cdad
编写于
5月 07, 2013
作者:
J
jgodinez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8011069: Printing: NullPointerException since jdk8 b82 showing native Page Setup Dialog.
Reviewed-by: bae, prr
上级
a715a5cc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
8 deletion
+22
-8
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
+13
-0
src/share/classes/sun/print/RasterPrinterJob.java
src/share/classes/sun/print/RasterPrinterJob.java
+9
-8
未找到文件。
src/macosx/classes/sun/lwawt/macosx/CPrinterJob.java
浏览文件 @
1442cdad
...
@@ -35,6 +35,7 @@ import java.security.PrivilegedAction;
...
@@ -35,6 +35,7 @@ import java.security.PrivilegedAction;
import
javax.print.*
;
import
javax.print.*
;
import
javax.print.attribute.PrintRequestAttributeSet
;
import
javax.print.attribute.PrintRequestAttributeSet
;
import
javax.print.attribute.HashPrintRequestAttributeSet
;
import
sun.java2d.*
;
import
sun.java2d.*
;
import
sun.print.*
;
import
sun.print.*
;
...
@@ -96,6 +97,14 @@ public class CPrinterJob extends RasterPrinterJob {
...
@@ -96,6 +97,14 @@ public class CPrinterJob extends RasterPrinterJob {
return
false
;
return
false
;
}
}
if
(
attributes
==
null
)
{
attributes
=
new
HashPrintRequestAttributeSet
();
}
if
(
getPrintService
()
instanceof
StreamPrintService
)
{
return
super
.
printDialog
(
attributes
);
}
return
jobSetup
(
getPageable
(),
checkAllowedToPrintToFile
());
return
jobSetup
(
getPageable
(),
checkAllowedToPrintToFile
());
}
}
...
@@ -130,6 +139,10 @@ public class CPrinterJob extends RasterPrinterJob {
...
@@ -130,6 +139,10 @@ public class CPrinterJob extends RasterPrinterJob {
return
page
;
return
page
;
}
}
if
(
getPrintService
()
instanceof
StreamPrintService
)
{
return
super
.
pageDialog
(
page
);
}
PageFormat
pageClone
=
(
PageFormat
)
page
.
clone
();
PageFormat
pageClone
=
(
PageFormat
)
page
.
clone
();
boolean
doIt
=
pageSetup
(
pageClone
,
null
);
boolean
doIt
=
pageSetup
(
pageClone
,
null
);
return
doIt
?
pageClone
:
page
;
return
doIt
?
pageClone
:
page
;
...
...
src/share/classes/sun/print/RasterPrinterJob.java
浏览文件 @
1442cdad
...
@@ -607,13 +607,17 @@ public abstract class RasterPrinterJob extends PrinterJob {
...
@@ -607,13 +607,17 @@ public abstract class RasterPrinterJob extends PrinterJob {
protected
void
updatePageAttributes
(
PrintService
service
,
protected
void
updatePageAttributes
(
PrintService
service
,
PageFormat
page
)
{
PageFormat
page
)
{
if
(
this
.
attributes
==
null
)
{
this
.
attributes
=
new
HashPrintRequestAttributeSet
();
}
updateAttributesWithPageFormat
(
service
,
page
,
this
.
attributes
);
updateAttributesWithPageFormat
(
service
,
page
,
this
.
attributes
);
}
}
protected
void
updateAttributesWithPageFormat
(
PrintService
service
,
protected
void
updateAttributesWithPageFormat
(
PrintService
service
,
PageFormat
page
,
PageFormat
page
,
PrintRequestAttributeSet
a
ttributes
)
{
PrintRequestAttributeSet
pageA
ttributes
)
{
if
(
service
==
null
||
page
==
null
)
{
if
(
service
==
null
||
page
==
null
||
pageAttributes
==
null
)
{
return
;
return
;
}
}
...
@@ -653,13 +657,10 @@ public abstract class RasterPrinterJob extends PrinterJob {
...
@@ -653,13 +657,10 @@ public abstract class RasterPrinterJob extends PrinterJob {
orient
=
OrientationRequested
.
PORTRAIT
;
orient
=
OrientationRequested
.
PORTRAIT
;
}
}
if
(
attributes
==
null
)
{
attributes
=
new
HashPrintRequestAttributeSet
();
}
if
(
media
!=
null
)
{
if
(
media
!=
null
)
{
a
ttributes
.
add
(
media
);
pageA
ttributes
.
add
(
media
);
}
}
a
ttributes
.
add
(
orient
);
pageA
ttributes
.
add
(
orient
);
float
ix
=
(
float
)(
page
.
getPaper
().
getImageableX
()/
DPI
);
float
ix
=
(
float
)(
page
.
getPaper
().
getImageableX
()/
DPI
);
float
iw
=
(
float
)(
page
.
getPaper
().
getImageableWidth
()/
DPI
);
float
iw
=
(
float
)(
page
.
getPaper
().
getImageableWidth
()/
DPI
);
...
@@ -667,7 +668,7 @@ public abstract class RasterPrinterJob extends PrinterJob {
...
@@ -667,7 +668,7 @@ public abstract class RasterPrinterJob extends PrinterJob {
float
ih
=
(
float
)(
page
.
getPaper
().
getImageableHeight
()/
DPI
);
float
ih
=
(
float
)(
page
.
getPaper
().
getImageableHeight
()/
DPI
);
if
(
ix
<
0
)
ix
=
0
f
;
if
(
iy
<
0
)
iy
=
0
f
;
if
(
ix
<
0
)
ix
=
0
f
;
if
(
iy
<
0
)
iy
=
0
f
;
try
{
try
{
a
ttributes
.
add
(
new
MediaPrintableArea
(
ix
,
iy
,
iw
,
ih
,
pageA
ttributes
.
add
(
new
MediaPrintableArea
(
ix
,
iy
,
iw
,
ih
,
MediaPrintableArea
.
INCH
));
MediaPrintableArea
.
INCH
));
}
catch
(
IllegalArgumentException
iae
)
{
}
catch
(
IllegalArgumentException
iae
)
{
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录