Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
2b93640a
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看板
提交
2b93640a
编写于
8月 19, 2013
作者:
J
jgodinez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8022241: [macosx] [PIT] lookupPrintServices() returns one too long array
Reviewed-by: prr, jchen
上级
7cceecb4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
9 deletion
+23
-9
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
+23
-9
未找到文件。
src/solaris/classes/sun/print/UnixPrintServiceLookup.java
浏览文件 @
2b93640a
...
...
@@ -245,7 +245,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
continue
;
}
if
((
defaultPrintService
!=
null
)
&&
printers
[
p
].
equals
(
defaultPrintService
.
getName
(
)))
{
&&
printers
[
p
].
equals
(
getPrinterDestName
(
defaultPrintService
)))
{
printerList
.
add
(
defaultPrintService
);
defaultIndex
=
printerList
.
size
()
-
1
;
}
else
{
...
...
@@ -270,11 +270,12 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
}
else
{
int
j
;
for
(
j
=
0
;
j
<
printServices
.
length
;
j
++)
{
if
((
printServices
[
j
]
!=
null
)
&&
(
printers
[
p
].
equals
(
printServices
[
j
].
getName
())))
{
printerList
.
add
(
printServices
[
j
]);
printServices
[
j
]
=
null
;
break
;
if
(
printServices
[
j
]
!=
null
)
{
if
(
printers
[
p
].
equals
(
getPrinterDestName
(
printServices
[
j
])))
{
printerList
.
add
(
printServices
[
j
]);
printServices
[
j
]
=
null
;
break
;
}
}
}
...
...
@@ -360,6 +361,17 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
return
true
;
}
/*
* Gets the printer name compatible with the list of printers returned by
* the system when we query default or all the available printers.
*/
private
String
getPrinterDestName
(
PrintService
ps
)
{
if
(
isMac
())
{
return
((
IPPPrintService
)
ps
).
getDest
();
}
return
ps
.
getName
();
}
/* On a network with many (hundreds) of network printers, it
* can save several seconds if you know all you want is a particular
* printer, to ask for that printer rather than retrieving all printers.
...
...
@@ -369,10 +381,12 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
if
(
name
==
null
||
name
.
equals
(
""
)
||
!
checkPrinterName
(
name
))
{
return
null
;
}
/* check i
s
all printers are already available */
/* check i
f
all printers are already available */
if
(
printServices
!=
null
)
{
for
(
PrintService
printService
:
printServices
)
{
if
(
printService
.
getName
().
equals
(
name
))
{
PrinterName
printerName
=
(
PrinterName
)
printService
.
getAttribute
(
PrinterName
.
class
);
if
(
printerName
.
getValue
().
equals
(
name
))
{
return
printService
;
}
}
...
...
@@ -567,7 +581,7 @@ public class UnixPrintServiceLookup extends PrintServiceLookup
defaultPrintService
=
null
;
if
(
printServices
!=
null
)
{
for
(
int
j
=
0
;
j
<
printServices
.
length
;
j
++)
{
if
(
defaultPrinter
.
equals
(
printServices
[
j
].
getName
(
)))
{
if
(
defaultPrinter
.
equals
(
getPrinterDestName
(
printServices
[
j
]
)))
{
defaultPrintService
=
printServices
[
j
];
break
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录