Module: wine Branch: master Commit: c39268967d07f41b67a47fcea003a59a98a6dd41 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c39268967d07f41b67a47fcea0...
Author: Nikolay Sivov bunglehead@gmail.com Date: Sat Nov 21 11:59:33 2009 +0300
comctl32/listview: Do nothing on LVM_CANCELEDITLABEL if there's no label.
---
dlls/comctl32/listview.c | 11 +++++++---- dlls/comctl32/tests/listview.c | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index d59a984..594db6e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -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; } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 44c5eb2..6b3ebff 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -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);