comctl32/listview: Do nothing on LVM_CANCELEDITLABEL if there's no label.

This commit is contained in:
Nikolay Sivov 2009-11-21 11:59:33 +03:00 committed by Alexandre Julliard
parent 5f059edcdf
commit c39268967d
2 changed files with 10 additions and 4 deletions

View File

@ -5081,11 +5081,14 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte
*/
static LRESULT LISTVIEW_CancelEditLabel(LISTVIEW_INFO *infoPtr)
{
/* handle value will be lost after LISTVIEW_EndEditLabelT */
HWND edit = infoPtr->hwndEdit;
if (infoPtr->hwndEdit)
{
/* handle value will be lost after LISTVIEW_EndEditLabelT */
HWND edit = infoPtr->hwndEdit;
LISTVIEW_EndEditLabelT(infoPtr, TRUE, IsWindowUnicode(infoPtr->hwndEdit));
SendMessageW(edit, WM_CLOSE, 0, 0);
LISTVIEW_EndEditLabelT(infoPtr, TRUE, IsWindowUnicode(infoPtr->hwndEdit));
SendMessageW(edit, WM_CLOSE, 0, 0);
}
return TRUE;
}

View File

@ -3720,8 +3720,11 @@ static void test_canceleditlabel(void)
insert_item(hwnd, 0);
/* try without edit created */
flush_sequences(sequences, NUM_MSG_SEQUENCES);
ret = SendMessage(hwnd, LVM_CANCELEDITLABEL, 0, 0);
expect(TRUE, ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
"cancel edit label without edit", FALSE);
/* cancel without data change */
SetFocus(hwnd);