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
31be5005
Commit
31be5005
authored
Jul 19, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jul 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: toolbar: Test and fix invalid indexes passed in TB_ISBUTTON*.
parent
648f7b1d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
toolbar.c
dlls/comctl32/tests/toolbar.c
+9
-0
toolbar.c
dlls/comctl32/toolbar.c
+6
-6
No files found.
dlls/comctl32/tests/toolbar.c
View file @
31be5005
...
...
@@ -147,6 +147,15 @@ static void basic_test(void)
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1000
,
0
),
"A1 pressed
\n
"
);
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1007
,
0
),
"B2 not pressed
\n
"
);
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1008
,
0
),
"B3 pressed
\n
"
);
/* tests with invalid index */
compare
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
0xdeadbeef
,
0
),
-
1L
,
"%ld"
);
compare
(
SendMessage
(
hToolbar
,
TB_ISBUTTONPRESSED
,
0xdeadbeef
,
0
),
-
1L
,
"%ld"
);
compare
(
SendMessage
(
hToolbar
,
TB_ISBUTTONENABLED
,
0xdeadbeef
,
0
),
-
1L
,
"%ld"
);
compare
(
SendMessage
(
hToolbar
,
TB_ISBUTTONINDETERMINATE
,
0xdeadbeef
,
0
),
-
1L
,
"%ld"
);
compare
(
SendMessage
(
hToolbar
,
TB_ISBUTTONHIGHLIGHTED
,
0xdeadbeef
,
0
),
-
1L
,
"%ld"
);
compare
(
SendMessage
(
hToolbar
,
TB_ISBUTTONHIDDEN
,
0xdeadbeef
,
0
),
-
1L
,
"%ld"
);
DestroyWindow
(
hToolbar
);
}
...
...
dlls/comctl32/toolbar.c
View file @
31be5005
...
...
@@ -3840,7 +3840,7 @@ TOOLBAR_IsButtonChecked (HWND hwnd, WPARAM wParam, LPARAM lParam)
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
FALSE
);
if
(
nIndex
==
-
1
)
return
FALSE
;
return
-
1
;
return
(
infoPtr
->
buttons
[
nIndex
].
fsState
&
TBSTATE_CHECKED
);
}
...
...
@@ -3854,7 +3854,7 @@ TOOLBAR_IsButtonEnabled (HWND hwnd, WPARAM wParam, LPARAM lParam)
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
FALSE
);
if
(
nIndex
==
-
1
)
return
FALSE
;
return
-
1
;
return
(
infoPtr
->
buttons
[
nIndex
].
fsState
&
TBSTATE_ENABLED
);
}
...
...
@@ -3868,7 +3868,7 @@ TOOLBAR_IsButtonHidden (HWND hwnd, WPARAM wParam, LPARAM lParam)
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
FALSE
);
if
(
nIndex
==
-
1
)
return
TRUE
;
return
-
1
;
return
(
infoPtr
->
buttons
[
nIndex
].
fsState
&
TBSTATE_HIDDEN
);
}
...
...
@@ -3882,7 +3882,7 @@ TOOLBAR_IsButtonHighlighted (HWND hwnd, WPARAM wParam, LPARAM lParam)
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
FALSE
);
if
(
nIndex
==
-
1
)
return
FALSE
;
return
-
1
;
return
(
infoPtr
->
buttons
[
nIndex
].
fsState
&
TBSTATE_MARKED
);
}
...
...
@@ -3896,7 +3896,7 @@ TOOLBAR_IsButtonIndeterminate (HWND hwnd, WPARAM wParam, LPARAM lParam)
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
FALSE
);
if
(
nIndex
==
-
1
)
return
FALSE
;
return
-
1
;
return
(
infoPtr
->
buttons
[
nIndex
].
fsState
&
TBSTATE_INDETERMINATE
);
}
...
...
@@ -3910,7 +3910,7 @@ TOOLBAR_IsButtonPressed (HWND hwnd, WPARAM wParam, LPARAM lParam)
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
FALSE
);
if
(
nIndex
==
-
1
)
return
FALSE
;
return
-
1
;
return
(
infoPtr
->
buttons
[
nIndex
].
fsState
&
TBSTATE_PRESSED
);
}
...
...
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