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
ac31df43
Commit
ac31df43
authored
Oct 16, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix UDM_SETPOS behavior on out of range values.
parent
e6fce2de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
updown.c
dlls/comctl32/updown.c
+28
-21
No files found.
dlls/comctl32/updown.c
View file @
ac31df43
...
...
@@ -482,6 +482,32 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
return
0
;
}
static
int
UPDOWN_SetPos
(
UPDOWN_INFO
*
infoPtr
,
int
pos
)
{
int
ret
=
infoPtr
->
CurVal
;
if
(
!
UPDOWN_InBounds
(
infoPtr
,
pos
))
{
if
((
infoPtr
->
MinVal
<
infoPtr
->
MaxVal
&&
pos
<
infoPtr
->
MinVal
)
||
(
infoPtr
->
MinVal
>
infoPtr
->
MaxVal
&&
pos
>
infoPtr
->
MinVal
))
pos
=
infoPtr
->
MinVal
;
else
pos
=
infoPtr
->
MaxVal
;
}
infoPtr
->
CurVal
=
pos
;
UPDOWN_SetBuddyInt
(
infoPtr
);
if
(
!
UPDOWN_InBounds
(
infoPtr
,
ret
))
{
if
((
infoPtr
->
MinVal
<
infoPtr
->
MaxVal
&&
ret
<
infoPtr
->
MinVal
)
||
(
infoPtr
->
MinVal
>
infoPtr
->
MaxVal
&&
ret
>
infoPtr
->
MinVal
))
ret
=
infoPtr
->
MinVal
;
else
ret
=
infoPtr
->
MaxVal
;
}
return
ret
;
}
/***********************************************************************
* UPDOWN_SetRange
*
...
...
@@ -1069,17 +1095,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
}
case
UDM_SETPOS
:
{
int
temp
=
(
short
)
LOWORD
(
lParam
);
TRACE
(
"UpDown Ctrl new value(%d), hwnd=%p
\n
"
,
temp
,
hwnd
);
if
(
!
UPDOWN_InBounds
(
infoPtr
,
temp
))
{
if
(
temp
<
infoPtr
->
MinVal
)
temp
=
infoPtr
->
MinVal
;
if
(
temp
>
infoPtr
->
MaxVal
)
temp
=
infoPtr
->
MaxVal
;
}
wParam
=
infoPtr
->
CurVal
;
infoPtr
->
CurVal
=
temp
;
UPDOWN_SetBuddyInt
(
infoPtr
);
return
wParam
;
/* return prev value */
return
UPDOWN_SetPos
(
infoPtr
,
(
short
)
LOWORD
(
lParam
));
}
case
UDM_GETRANGE
:
return
MAKELONG
(
infoPtr
->
MaxVal
,
infoPtr
->
MinVal
);
...
...
@@ -1109,16 +1125,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
}
case
UDM_SETPOS32
:
{
int
temp
;
if
(
!
UPDOWN_InBounds
(
infoPtr
,
(
int
)
lParam
))
{
if
((
int
)
lParam
<
infoPtr
->
MinVal
)
lParam
=
infoPtr
->
MinVal
;
if
((
int
)
lParam
>
infoPtr
->
MaxVal
)
lParam
=
infoPtr
->
MaxVal
;
}
temp
=
infoPtr
->
CurVal
;
/* save prev value */
infoPtr
->
CurVal
=
(
int
)
lParam
;
/* set the new value */
UPDOWN_SetBuddyInt
(
infoPtr
);
return
temp
;
/* return prev value */
return
UPDOWN_SetPos
(
infoPtr
,
(
int
)
lParam
);
}
case
UDM_GETUNICODEFORMAT
:
/* we lie a bit here, we're always using Unicode internally */
...
...
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