Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
879eac46
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看板
提交
879eac46
编写于
7月 14, 2014
作者:
J
jgodinez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7067052: Default printer media is ignored
Reviewed-by: prr, bae
上级
fcdc7d87
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
13 deletion
+21
-13
src/solaris/classes/sun/print/CUPSPrinter.java
src/solaris/classes/sun/print/CUPSPrinter.java
+10
-0
src/solaris/classes/sun/print/IPPPrintService.java
src/solaris/classes/sun/print/IPPPrintService.java
+5
-12
src/solaris/native/sun/awt/CUPSfuncs.c
src/solaris/native/sun/awt/CUPSfuncs.c
+6
-1
未找到文件。
src/solaris/classes/sun/print/CUPSPrinter.java
浏览文件 @
879eac46
...
@@ -140,6 +140,9 @@ public class CUPSPrinter {
...
@@ -140,6 +140,9 @@ public class CUPSPrinter {
return
cupsCustomMediaSNames
;
return
cupsCustomMediaSNames
;
}
}
public
int
getDefaultMediaIndex
()
{
return
((
pageSizes
.
length
>
1
)
?
(
int
)(
pageSizes
[
pageSizes
.
length
-
1
])
:
0
);
}
/**
/**
* Returns array of MediaPrintableArea derived from PPD.
* Returns array of MediaPrintableArea derived from PPD.
...
@@ -201,8 +204,15 @@ public class CUPSPrinter {
...
@@ -201,8 +204,15 @@ public class CUPSPrinter {
// add this new custom msn to MediaSize array
// add this new custom msn to MediaSize array
if
((
width
>
0.0
)
&&
(
length
>
0.0
))
{
if
((
width
>
0.0
)
&&
(
length
>
0.0
))
{
try
{
new
MediaSize
(
width
,
length
,
new
MediaSize
(
width
,
length
,
Size2DSyntax
.
INCH
,
msn
);
Size2DSyntax
.
INCH
,
msn
);
}
catch
(
IllegalArgumentException
e
)
{
/* PDF printer in Linux for Ledger paper causes
"IllegalArgumentException: X dimension > Y dimension".
We rotate based on IPP spec. */
new
MediaSize
(
length
,
width
,
Size2DSyntax
.
INCH
,
msn
);
}
}
}
}
}
...
...
src/solaris/classes/sun/print/IPPPrintService.java
浏览文件 @
879eac46
...
@@ -414,6 +414,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
...
@@ -414,6 +414,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
mediaSizeNames
=
cps
.
getMediaSizeNames
();
mediaSizeNames
=
cps
.
getMediaSizeNames
();
mediaTrays
=
cps
.
getMediaTrays
();
mediaTrays
=
cps
.
getMediaTrays
();
customMediaSizeNames
=
cps
.
getCustomMediaSizeNames
();
customMediaSizeNames
=
cps
.
getCustomMediaSizeNames
();
defaultMediaIndex
=
cps
.
getDefaultMediaIndex
();
urlConnection
.
disconnect
();
urlConnection
.
disconnect
();
init
=
true
;
init
=
true
;
return
;
return
;
...
@@ -1432,7 +1433,9 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
...
@@ -1432,7 +1433,9 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
return
JobSheets
.
STANDARD
;
return
JobSheets
.
STANDARD
;
}
}
}
else
if
(
category
==
Media
.
class
)
{
}
else
if
(
category
==
Media
.
class
)
{
defaultMediaIndex
=
0
;
if
(
defaultMediaIndex
==
-
1
)
{
defaultMediaIndex
=
0
;
}
if
(
mediaSizeNames
.
length
==
0
)
{
if
(
mediaSizeNames
.
length
==
0
)
{
String
defaultCountry
=
Locale
.
getDefault
().
getCountry
();
String
defaultCountry
=
Locale
.
getDefault
().
getCountry
();
if
(
defaultCountry
!=
null
&&
if
(
defaultCountry
!=
null
&&
...
@@ -1448,17 +1451,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
...
@@ -1448,17 +1451,7 @@ public class IPPPrintService implements PrintService, SunPrinterJobService {
if
(
attribClass
!=
null
)
{
if
(
attribClass
!=
null
)
{
String
name
=
attribClass
.
getStringValue
();
String
name
=
attribClass
.
getStringValue
();
if
(
isCupsPrinter
)
{
if
(
isCupsPrinter
)
{
for
(
int
i
=
0
;
i
<
customMediaSizeNames
.
length
;
i
++)
{
return
mediaSizeNames
[
defaultMediaIndex
];
//REMIND: get default from PPD. In native _getMedia,
// move default (ppd_option_t->defchoice) to index 0.
// In the meantime, use indexOf because PPD name
// may be different from the IPP attribute name.
if
(
customMediaSizeNames
[
i
].
toString
().
indexOf
(
name
)
!=
-
1
)
{
defaultMediaIndex
=
i
;
return
mediaSizeNames
[
defaultMediaIndex
];
}
}
}
else
{
}
else
{
for
(
int
i
=
0
;
i
<
mediaSizeNames
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
mediaSizeNames
.
length
;
i
++)
{
if
(
mediaSizeNames
[
i
].
toString
().
indexOf
(
name
)
!=
-
1
)
{
if
(
mediaSizeNames
[
i
].
toString
().
indexOf
(
name
)
!=
-
1
)
{
...
...
src/solaris/native/sun/awt/CUPSfuncs.c
浏览文件 @
879eac46
...
@@ -349,7 +349,8 @@ Java_sun_print_CUPSPrinter_getPageSizes(JNIEnv *env,
...
@@ -349,7 +349,8 @@ Java_sun_print_CUPSPrinter_getPageSizes(JNIEnv *env,
// create array of dimensions - (num_choices * 6)
// create array of dimensions - (num_choices * 6)
//to cover length & height
//to cover length & height
DPRINTF
(
"CUPSfuncs::option->num_choices %d
\n
"
,
option
->
num_choices
)
DPRINTF
(
"CUPSfuncs::option->num_choices %d
\n
"
,
option
->
num_choices
)
sizeArray
=
(
*
env
)
->
NewFloatArray
(
env
,
option
->
num_choices
*
6
);
// +1 is for storing the default media index
sizeArray
=
(
*
env
)
->
NewFloatArray
(
env
,
option
->
num_choices
*
6
+
1
);
if
(
sizeArray
==
NULL
)
{
if
(
sizeArray
==
NULL
)
{
unlink
(
filename
);
unlink
(
filename
);
j2d_ppdClose
(
ppd
);
j2d_ppdClose
(
ppd
);
...
@@ -369,6 +370,10 @@ Java_sun_print_CUPSPrinter_getPageSizes(JNIEnv *env,
...
@@ -369,6 +370,10 @@ Java_sun_print_CUPSPrinter_getPageSizes(JNIEnv *env,
}
}
for
(
i
=
0
;
i
<
option
->
num_choices
;
i
++
)
{
for
(
i
=
0
;
i
<
option
->
num_choices
;
i
++
)
{
choice
=
(
option
->
choices
)
+
i
;
choice
=
(
option
->
choices
)
+
i
;
// get the index of the default page
if
(
!
strcmp
(
choice
->
choice
,
option
->
defchoice
))
{
dims
[
option
->
num_choices
*
6
]
=
(
float
)
i
;
}
size
=
j2d_ppdPageSize
(
ppd
,
choice
->
choice
);
size
=
j2d_ppdPageSize
(
ppd
,
choice
->
choice
);
if
(
size
!=
NULL
)
{
if
(
size
!=
NULL
)
{
// paper width and height
// paper width and height
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录