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
c1115004
Commit
c1115004
authored
Jun 06, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Edit box should be destroyed on invalid index too (LVM_EDITLABEL).
parent
e90102d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
listview.c
dlls/comctl32/listview.c
+4
-3
listview.c
dlls/comctl32/tests/listview.c
+32
-0
No files found.
dlls/comctl32/listview.c
View file @
c1115004
...
...
@@ -5060,9 +5060,6 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
TRACE
(
"(nItem=%d, isW=%d)
\n
"
,
nItem
,
isW
);
if
(
~
infoPtr
->
dwStyle
&
LVS_EDITLABELS
)
return
0
;
if
(
nItem
<
0
||
nItem
>=
infoPtr
->
nItemCount
)
return
0
;
infoPtr
->
nEditLabelItem
=
nItem
;
/* Is the EditBox still there, if so remove it */
if
(
infoPtr
->
hwndEdit
!=
0
)
...
...
@@ -5071,6 +5068,10 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
infoPtr
->
hwndEdit
=
0
;
}
if
(
nItem
<
0
||
nItem
>=
infoPtr
->
nItemCount
)
return
0
;
infoPtr
->
nEditLabelItem
=
nItem
;
LISTVIEW_SetSelection
(
infoPtr
,
nItem
);
LISTVIEW_SetItemFocus
(
infoPtr
,
nItem
);
LISTVIEW_InvalidateItem
(
infoPtr
,
nItem
);
...
...
dlls/comctl32/tests/listview.c
View file @
c1115004
...
...
@@ -2957,6 +2957,38 @@ static void test_editbox(void)
expect
(
lstrlen
(
item
.
pszText
),
r
);
ok
(
strcmp
(
buffer
,
testitem1A
)
==
0
,
"Expected item text to change
\n
"
);
/* LVM_EDITLABEL with -1 destroys current edit */
hwndedit
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_GETEDITCONTROL
,
0
,
0
);
ok
(
hwndedit
==
NULL
,
"Expected Edit window not to be created
\n
"
);
/* no edit present */
hwndedit
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
-
1
,
0
);
ok
(
hwndedit
==
NULL
,
"Expected Edit window not to be created
\n
"
);
hwndedit
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
0
,
0
);
ok
(
IsWindow
(
hwndedit
),
"Expected Edit window to be created
\n
"
);
/* edit present */
ok
(
GetFocus
()
==
hwndedit
,
"Expected Edit to be focused
\n
"
);
hwndedit2
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
-
1
,
0
);
ok
(
hwndedit2
==
NULL
,
"Expected Edit window not to be created
\n
"
);
ok
(
!
IsWindow
(
hwndedit
),
"Expected Edit window to be destroyed
\n
"
);
ok
(
GetFocus
()
==
hwnd
,
"Expected List to be focused
\n
"
);
/* check another negative value */
hwndedit
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
0
,
0
);
ok
(
IsWindow
(
hwndedit
),
"Expected Edit window to be created
\n
"
);
ok
(
GetFocus
()
==
hwndedit
,
"Expected Edit to be focused
\n
"
);
hwndedit2
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
-
2
,
0
);
ok
(
hwndedit2
==
NULL
,
"Expected Edit window not to be created
\n
"
);
ok
(
!
IsWindow
(
hwndedit
),
"Expected Edit window to be destroyed
\n
"
);
ok
(
GetFocus
()
==
hwnd
,
"Expected List to be focused
\n
"
);
/* and value greater then max item index */
hwndedit
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
0
,
0
);
ok
(
IsWindow
(
hwndedit
),
"Expected Edit window to be created
\n
"
);
ok
(
GetFocus
()
==
hwndedit
,
"Expected Edit to be focused
\n
"
);
r
=
SendMessage
(
hwnd
,
LVM_GETITEMCOUNT
,
0
,
0
);
hwndedit2
=
(
HWND
)
SendMessage
(
hwnd
,
LVM_EDITLABEL
,
r
,
0
);
ok
(
hwndedit2
==
NULL
,
"Expected Edit window not to be created
\n
"
);
ok
(
!
IsWindow
(
hwndedit
),
"Expected Edit window to be destroyed
\n
"
);
ok
(
GetFocus
()
==
hwnd
,
"Expected List to be focused
\n
"
);
DestroyWindow
(
hwnd
);
}
...
...
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