Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0a4d094a
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看板
提交
0a4d094a
编写于
7月 23, 2012
作者:
A
alexsch
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7185512: The printout doesn't match image on screen.
Reviewed-by: serb, bagiras
上级
46d54ef2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
36 deletion
+46
-36
src/windows/native/sun/windows/awt_TextArea.cpp
src/windows/native/sun/windows/awt_TextArea.cpp
+1
-36
src/windows/native/sun/windows/awt_TextComponent.cpp
src/windows/native/sun/windows/awt_TextComponent.cpp
+44
-0
src/windows/native/sun/windows/awt_TextComponent.h
src/windows/native/sun/windows/awt_TextComponent.h
+1
-0
未找到文件。
src/windows/native/sun/windows/awt_TextArea.cpp
浏览文件 @
0a4d094a
...
...
@@ -131,48 +131,13 @@ AwtTextArea::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
MsgRouting
mr
=
mrDoDefault
;
switch
(
message
)
{
case
WM_PRINTCLIENT
:
{
FORMATRANGE
fr
;
HDC
hPrinterDC
=
(
HDC
)
wParam
;
int
nHorizRes
=
::
GetDeviceCaps
(
hPrinterDC
,
HORZRES
);
int
nVertRes
=
::
GetDeviceCaps
(
hPrinterDC
,
VERTRES
);
int
nLogPixelsX
=
::
GetDeviceCaps
(
hPrinterDC
,
LOGPIXELSX
);
int
nLogPixelsY
=
::
GetDeviceCaps
(
hPrinterDC
,
LOGPIXELSY
);
// Ensure the printer DC is in MM_TEXT mode.
::
SetMapMode
(
hPrinterDC
,
MM_TEXT
);
// Rendering to the same DC we are measuring.
::
ZeroMemory
(
&
fr
,
sizeof
(
fr
));
fr
.
hdc
=
fr
.
hdcTarget
=
hPrinterDC
;
// Set up the page.
fr
.
rcPage
.
left
=
fr
.
rcPage
.
top
=
0
;
fr
.
rcPage
.
right
=
(
nHorizRes
/
nLogPixelsX
)
*
1440
;
// in twips
fr
.
rcPage
.
bottom
=
(
nVertRes
/
nLogPixelsY
)
*
1440
;
fr
.
rc
.
left
=
fr
.
rcPage
.
left
;
fr
.
rc
.
top
=
fr
.
rcPage
.
top
;
fr
.
rc
.
right
=
fr
.
rcPage
.
right
;
fr
.
rc
.
bottom
=
fr
.
rcPage
.
bottom
;
// start printing from the first visible line
LRESULT
nLine
=
SendMessage
(
EM_GETFIRSTVISIBLELINE
,
0
,
0
);
LONG
startCh
=
static_cast
<
LONG
>
(
SendMessage
(
EM_LINEINDEX
,
(
WPARAM
)
nLine
,
0
));
fr
.
chrg
.
cpMin
=
startCh
;
fr
.
chrg
.
cpMax
=
-
1
;
SendMessage
(
EM_FORMATRANGE
,
TRUE
,
(
LPARAM
)
&
fr
);
}
break
;
case
EM_SETCHARFORMAT
:
case
WM_SETFONT
:
SetIgnoreEnChange
(
TRUE
);
break
;
}
retValue
=
AwtComponent
::
WindowProc
(
message
,
wParam
,
lParam
);
retValue
=
Awt
Text
Component
::
WindowProc
(
message
,
wParam
,
lParam
);
switch
(
message
)
{
case
EM_SETCHARFORMAT
:
...
...
src/windows/native/sun/windows/awt_TextComponent.cpp
浏览文件 @
0a4d094a
...
...
@@ -215,6 +215,50 @@ done:
return
c
;
}
LRESULT
AwtTextComponent
::
WindowProc
(
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
message
)
{
case
WM_PRINTCLIENT
:
{
FORMATRANGE
fr
;
HDC
hPrinterDC
=
(
HDC
)
wParam
;
int
nHorizRes
=
::
GetDeviceCaps
(
hPrinterDC
,
HORZRES
);
int
nVertRes
=
::
GetDeviceCaps
(
hPrinterDC
,
VERTRES
);
int
nLogPixelsX
=
::
GetDeviceCaps
(
hPrinterDC
,
LOGPIXELSX
);
int
nLogPixelsY
=
::
GetDeviceCaps
(
hPrinterDC
,
LOGPIXELSY
);
// Ensure the printer DC is in MM_TEXT mode.
::
SetMapMode
(
hPrinterDC
,
MM_TEXT
);
// Rendering to the same DC we are measuring.
::
ZeroMemory
(
&
fr
,
sizeof
(
fr
));
fr
.
hdc
=
fr
.
hdcTarget
=
hPrinterDC
;
// Set up the page.
fr
.
rcPage
.
left
=
fr
.
rcPage
.
top
=
0
;
fr
.
rcPage
.
right
=
(
nHorizRes
/
nLogPixelsX
)
*
1440
;
// in twips
fr
.
rcPage
.
bottom
=
(
nVertRes
/
nLogPixelsY
)
*
1440
;
fr
.
rc
.
left
=
fr
.
rcPage
.
left
;
fr
.
rc
.
top
=
fr
.
rcPage
.
top
;
fr
.
rc
.
right
=
fr
.
rcPage
.
right
;
fr
.
rc
.
bottom
=
fr
.
rcPage
.
bottom
;
// start printing from the first visible line
LRESULT
nLine
=
SendMessage
(
EM_GETFIRSTVISIBLELINE
,
0
,
0
);
LONG
startCh
=
static_cast
<
LONG
>
(
SendMessage
(
EM_LINEINDEX
,
(
WPARAM
)
nLine
,
0
));
fr
.
chrg
.
cpMin
=
startCh
;
fr
.
chrg
.
cpMax
=
-
1
;
SendMessage
(
EM_FORMATRANGE
,
TRUE
,
(
LPARAM
)
&
fr
);
}
break
;
}
return
AwtComponent
::
WindowProc
(
message
,
wParam
,
lParam
);
}
LONG
AwtTextComponent
::
EditGetCharFromPos
(
POINT
&
pt
)
{
return
static_cast
<
LONG
>
(
SendMessage
(
EM_CHARFROMPOS
,
0
,
reinterpret_cast
<
LPARAM
>
(
&
pt
)));
...
...
src/windows/native/sun/windows/awt_TextComponent.h
浏览文件 @
0a4d094a
...
...
@@ -50,6 +50,7 @@ public:
static
AwtTextComponent
*
Create
(
jobject
self
,
jobject
parent
,
BOOL
isMultiline
);
virtual
LPCTSTR
GetClassName
();
LRESULT
WindowProc
(
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
);
int
RemoveCR
(
WCHAR
*
pStr
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录