Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
0f670168
Commit
0f670168
authored
Sep 18, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 18, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/trackbar: Protect from negative tic count in recalculation helper.
Fix for regression introduced in
42c83b9d
parent
891d7629
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
trackbar.c
dlls/comctl32/tests/trackbar.c
+23
-4
trackbar.c
dlls/comctl32/trackbar.c
+1
-1
No files found.
dlls/comctl32/tests/trackbar.c
View file @
0f670168
...
...
@@ -785,22 +785,41 @@ static void test_tic_settings(HWND hWndTrackbar){
/* test TBM_SETTICFREQ */
SendMessage
(
hWndTrackbar
,
TBM_SETRANGE
,
TRUE
,
MAKELONG
(
0
,
10
));
SendMessage
(
hWndTrackbar
,
TBM_SETTICFREQ
,
2
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
6
,
r
);
SendMessage
(
hWndTrackbar
,
TBM_SETTICFREQ
,
5
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
3
,
r
);
SendMessage
(
hWndTrackbar
,
TBM_SETTICFREQ
,
15
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
2
,
r
);
/* test TBM_GETNUMTICS */
/* since TIC FREQ is 15, there should be only 2 tics now */
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
2
,
r
);
ok_sequence
(
sequences
,
TRACKBAR_SEQ_INDEX
,
tic_settings_test_seq
,
"tic settings test sequence"
,
TRUE
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
parent_tic_settings_test_seq
,
"parent tic settings test sequence"
,
TRUE
);
/* range [0,0], freq = 1 */
SendMessage
(
hWndTrackbar
,
TBM_SETRANGEMAX
,
TRUE
,
0
);
SendMessage
(
hWndTrackbar
,
TBM_SETRANGEMIN
,
TRUE
,
0
);
SendMessage
(
hWndTrackbar
,
TBM_SETTICFREQ
,
1
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
2
,
r
);
/* range [0,1], freq = 1 */
SendMessage
(
hWndTrackbar
,
TBM_SETRANGEMAX
,
TRUE
,
1
);
SendMessage
(
hWndTrackbar
,
TBM_SETRANGEMIN
,
TRUE
,
0
);
SendMessage
(
hWndTrackbar
,
TBM_SETTICFREQ
,
1
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
2
,
r
);
/* range [0,2], freq = 1 */
SendMessage
(
hWndTrackbar
,
TBM_SETRANGEMAX
,
TRUE
,
2
);
SendMessage
(
hWndTrackbar
,
TBM_SETRANGEMIN
,
TRUE
,
0
);
SendMessage
(
hWndTrackbar
,
TBM_SETTICFREQ
,
1
,
0
);
r
=
SendMessage
(
hWndTrackbar
,
TBM_GETNUMTICS
,
0
,
0
);
expect
(
3
,
r
);
}
static
void
test_tic_placement
(
HWND
hWndTrackbar
){
...
...
dlls/comctl32/trackbar.c
View file @
0f670168
...
...
@@ -155,7 +155,7 @@ static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
if
(
infoPtr
->
uTicFreq
&&
infoPtr
->
lRangeMax
>=
infoPtr
->
lRangeMin
)
{
nrTics
=
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
/
infoPtr
->
uTicFreq
;
/* don't add extra tic if there's no remainder */
if
(
(
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
%
infoPtr
->
uTicFreq
==
0
)
if
(
nrTics
&&
((
infoPtr
->
lRangeMax
-
infoPtr
->
lRangeMin
)
%
infoPtr
->
uTicFreq
==
0
)
)
nrTics
--
;
}
else
{
...
...
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