Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ba3a6d1f
Commit
ba3a6d1f
authored
Apr 04, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix Edit margins calculation for empty client area case.
parent
f820d972
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
edit.c
dlls/user32/edit.c
+1
-1
edit.c
dlls/user32/tests/edit.c
+42
-0
No files found.
dlls/user32/edit.c
View file @
ba3a6d1f
...
...
@@ -2914,7 +2914,7 @@ static void EDIT_EM_SetMargins(EDITSTATE *es, INT action,
default_right_margin
=
tm
.
tmAveCharWidth
/
2
;
min_size
=
calc_min_set_margin_size
(
dc
,
default_left_margin
,
default_right_margin
);
GetClientRect
(
es
->
hwndSelf
,
&
rc
);
if
(
rc
.
right
-
rc
.
left
<
min_size
)
{
if
(
!
IsRectEmpty
(
&
rc
)
&&
(
rc
.
right
-
rc
.
left
<
min_size
)
)
{
default_left_margin
=
es
->
left_margin
;
default_right_margin
=
es
->
right_margin
;
}
...
...
dlls/user32/tests/edit.c
View file @
ba3a6d1f
...
...
@@ -1423,6 +1423,8 @@ static void test_margins(void)
RECT
old_rect
,
new_rect
;
INT
old_right_margin
;
DWORD
old_margins
,
new_margins
;
LOGFONTA
lf
;
HFONT
hfont
;
hwEdit
=
create_editcontrol
(
WS_BORDER
|
ES_AUTOHSCROLL
|
ES_AUTOVSCROLL
,
0
);
...
...
@@ -1470,6 +1472,46 @@ static void test_margins(void)
ok
(
new_rect
.
bottom
==
old_rect
.
bottom
,
"The bottom border of the rectangle has changed
\n
"
);
DestroyWindow
(
hwEdit
);
memset
(
&
lf
,
0
,
sizeof
(
lf
));
lf
.
lfHeight
=
-
11
;
lf
.
lfWeight
=
FW_NORMAL
;
lf
.
lfCharSet
=
DEFAULT_CHARSET
;
strcpy
(
lf
.
lfFaceName
,
"Tahoma"
);
hfont
=
CreateFontIndirectA
(
&
lf
);
ok
(
hfont
!=
NULL
,
"got %p
\n
"
,
hfont
);
/* Empty window rectangle */
hwEdit
=
CreateWindowExA
(
0
,
"Edit"
,
"A"
,
WS_POPUP
,
0
,
0
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwEdit
!=
NULL
,
"got %p
\n
"
,
hwEdit
);
GetClientRect
(
hwEdit
,
&
old_rect
);
ok
(
IsRectEmpty
(
&
old_rect
),
"got rect %d,%d-%d,%d
\n
"
,
old_rect
.
left
,
old_rect
.
top
,
old_rect
.
right
,
old_rect
.
bottom
);
old_margins
=
SendMessageA
(
hwEdit
,
EM_GETMARGINS
,
0
,
0
);
ok
(
old_margins
==
0
,
"got %x
\n
"
,
old_margins
);
SendMessageA
(
hwEdit
,
WM_SETFONT
,
(
WPARAM
)
hfont
,
MAKELPARAM
(
TRUE
,
0
));
old_margins
=
SendMessageA
(
hwEdit
,
EM_GETMARGINS
,
0
,
0
);
ok
(
HIWORD
(
old_margins
)
>
0
&&
LOWORD
(
old_margins
)
>
0
,
"got %d, %d
\n
"
,
HIWORD
(
old_margins
),
LOWORD
(
old_margins
));
DestroyWindow
(
hwEdit
);
/* Size is not enough to display a text, but not empty */
hwEdit
=
CreateWindowExA
(
0
,
"Edit"
,
"A"
,
WS_POPUP
,
0
,
0
,
2
,
2
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hwEdit
!=
NULL
,
"got %p
\n
"
,
hwEdit
);
GetClientRect
(
hwEdit
,
&
old_rect
);
ok
(
!
IsRectEmpty
(
&
old_rect
),
"got rect %d,%d-%d,%d
\n
"
,
old_rect
.
left
,
old_rect
.
top
,
old_rect
.
right
,
old_rect
.
bottom
);
old_margins
=
SendMessageA
(
hwEdit
,
EM_GETMARGINS
,
0
,
0
);
ok
(
old_margins
==
0
,
"got %x
\n
"
,
old_margins
);
SendMessageA
(
hwEdit
,
WM_SETFONT
,
(
WPARAM
)
hfont
,
MAKELPARAM
(
TRUE
,
0
));
old_margins
=
SendMessageA
(
hwEdit
,
EM_GETMARGINS
,
0
,
0
);
ok
(
old_margins
==
0
,
"got %d, %d
\n
"
,
HIWORD
(
old_margins
),
LOWORD
(
old_margins
));
DeleteObject
(
hfont
);
DestroyWindow
(
hwEdit
);
}
static
INT
CALLBACK
find_font_proc
(
const
LOGFONTA
*
elf
,
const
TEXTMETRICA
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment