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
33a1e827
Commit
33a1e827
authored
Nov 20, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tab: Fix selection change when selected item is deleted.
parent
336a68be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
tab.c
dlls/comctl32/tab.c
+3
-4
tab.c
dlls/comctl32/tests/tab.c
+23
-0
No files found.
dlls/comctl32/tab.c
View file @
33a1e827
...
...
@@ -2916,10 +2916,9 @@ static LRESULT TAB_DeleteItem (TAB_INFO *infoPtr, INT iItem)
Free
(
oldItems
);
/* Readjust the selected index */
if
((
iItem
==
infoPtr
->
iSelected
)
&&
(
iItem
>
0
))
infoPtr
->
iSelected
--
;
if
(
iItem
<
infoPtr
->
iSelected
)
if
(
iItem
==
infoPtr
->
iSelected
)
infoPtr
->
iSelected
=
-
1
;
else
if
(
iItem
<
infoPtr
->
iSelected
)
infoPtr
->
iSelected
--
;
if
(
infoPtr
->
uNumItem
==
0
)
...
...
dlls/comctl32/tests/tab.c
View file @
33a1e827
...
...
@@ -1176,6 +1176,28 @@ static void test_removeimage(HWND parent_wnd)
DestroyIcon
(
hicon
);
}
static
void
test_delete_selection
(
HWND
parent_wnd
)
{
HWND
hTab
;
DWORD
ret
;
hTab
=
createFilledTabControl
(
parent_wnd
,
TCS_FIXEDWIDTH
,
TCIF_TEXT
|
TCIF_IMAGE
,
4
);
ok
(
hTab
!=
NULL
,
"Failed to create tab control
\n
"
);
ret
=
SendMessage
(
hTab
,
TCM_SETCURSEL
,
3
,
0
);
expect
(
0
,
ret
);
ret
=
SendMessage
(
hTab
,
TCM_GETCURSEL
,
0
,
0
);
expect
(
3
,
ret
);
/* delete selected item - selection goes to -1 */
ret
=
SendMessage
(
hTab
,
TCM_DELETEITEM
,
3
,
0
);
expect
(
TRUE
,
ret
);
ret
=
SendMessage
(
hTab
,
TCM_GETCURSEL
,
0
,
0
);
expect
(
-
1
,
ret
);
DestroyWindow
(
hTab
);
}
START_TEST
(
tab
)
{
HWND
parent_wnd
;
...
...
@@ -1218,6 +1240,7 @@ START_TEST(tab)
test_insert_focus
(
parent_wnd
);
test_delete_focus
(
parent_wnd
);
test_delete_selection
(
parent_wnd
);
test_removeimage
(
parent_wnd
);
DestroyWindow
(
parent_wnd
);
...
...
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