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
750ce6be
Commit
750ce6be
authored
Dec 22, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/updown: Don't update buddy text if it's the same.
parent
3288911a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
1 deletion
+41
-1
updown.c
dlls/comctl32/tests/updown.c
+36
-0
updown.c
dlls/comctl32/updown.c
+5
-1
No files found.
dlls/comctl32/tests/updown.c
View file @
750ce6be
...
...
@@ -59,6 +59,9 @@
#define EDIT_SEQ_INDEX 1
#define UPDOWN_SEQ_INDEX 2
#define UPDOWN_ID 0
#define BUDDY_ID 1
static
HWND
parent_wnd
,
g_edit
;
static
BOOL
(
WINAPI
*
pSetWindowSubclass
)(
HWND
,
SUBCLASSPROC
,
UINT_PTR
,
DWORD_PTR
);
...
...
@@ -156,6 +159,11 @@ static const struct message test_updown_unicode_seq[] = {
{
0
}
};
static
const
struct
message
test_updown_pos_nochange_seq
[]
=
{
{
WM_GETTEXT
,
sent
|
id
,
0
,
0
,
BUDDY_ID
},
{
0
}
};
static
LRESULT
WINAPI
parent_wnd_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
LONG
defwndproc_counter
=
0
;
...
...
@@ -233,6 +241,7 @@ static LRESULT WINAPI edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam,
if
(
defwndproc_counter
)
msg
.
flags
|=
defwinproc
;
msg
.
wParam
=
wParam
;
msg
.
lParam
=
lParam
;
msg
.
id
=
BUDDY_ID
;
add_message
(
sequences
,
EDIT_SEQ_INDEX
,
&
msg
);
defwndproc_counter
++
;
...
...
@@ -274,6 +283,7 @@ static LRESULT WINAPI updown_subclass_proc(HWND hwnd, UINT message, WPARAM wPara
if
(
defwndproc_counter
)
msg
.
flags
|=
defwinproc
;
msg
.
wParam
=
wParam
;
msg
.
lParam
=
lParam
;
msg
.
id
=
UPDOWN_ID
;
add_message
(
sequences
,
UPDOWN_SEQ_INDEX
,
&
msg
);
defwndproc_counter
++
;
...
...
@@ -360,6 +370,19 @@ static void test_updown_pos(void)
ok_sequence
(
sequences
,
UPDOWN_SEQ_INDEX
,
test_updown_pos_seq
,
"test updown pos"
,
FALSE
);
DestroyWindow
(
updown
);
/* there's no attempt to update buddy Edit if text didn't change */
SetWindowTextA
(
g_edit
,
"50"
);
updown
=
create_updown_control
(
UDS_ALIGNRIGHT
|
UDS_SETBUDDYINT
,
g_edit
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
r
=
SendMessage
(
updown
,
UDM_SETPOS
,
0
,
50
);
expect
(
50
,
r
);
ok_sequence
(
sequences
,
EDIT_SEQ_INDEX
,
test_updown_pos_nochange_seq
,
"test updown pos, no change"
,
FALSE
);
DestroyWindow
(
updown
);
}
static
void
test_updown_pos32
(
void
)
...
...
@@ -434,6 +457,19 @@ static void test_updown_pos32(void)
ok_sequence
(
sequences
,
UPDOWN_SEQ_INDEX
,
test_updown_pos32_seq
,
"test updown pos32"
,
FALSE
);
DestroyWindow
(
updown
);
/* there's no attempt to update buddy Edit if text didn't change */
SetWindowTextA
(
g_edit
,
"50"
);
updown
=
create_updown_control
(
UDS_ALIGNRIGHT
|
UDS_SETBUDDYINT
,
g_edit
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
r
=
SendMessage
(
updown
,
UDM_SETPOS32
,
0
,
50
);
expect
(
50
,
r
);
ok_sequence
(
sequences
,
EDIT_SEQ_INDEX
,
test_updown_pos_nochange_seq
,
"test updown pos, no change"
,
FALSE
);
DestroyWindow
(
updown
);
}
static
void
test_updown_buddy
(
void
)
...
...
dlls/comctl32/updown.c
View file @
750ce6be
...
...
@@ -310,7 +310,7 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
static
BOOL
UPDOWN_SetBuddyInt
(
const
UPDOWN_INFO
*
infoPtr
)
{
WCHAR
fmt
[
3
]
=
{
'%'
,
'd'
,
'\0'
};
WCHAR
txt
[
20
];
WCHAR
txt
[
20
]
,
txt_old
[
20
]
=
{
0
}
;
int
len
;
if
(
!
((
infoPtr
->
Flags
&
FLAG_BUDDYINT
)
&&
IsWindow
(
infoPtr
->
Buddy
)))
...
...
@@ -345,6 +345,10 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
*
dst
=
0
;
}
/* if nothing changed exit earlier */
GetWindowTextW
(
infoPtr
->
Buddy
,
txt_old
,
sizeof
(
txt_old
)
/
sizeof
(
WCHAR
));
if
(
lstrcmpiW
(
txt_old
,
txt
)
==
0
)
return
0
;
return
SetWindowTextW
(
infoPtr
->
Buddy
,
txt
);
}
...
...
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