Module: wine Branch: master Commit: e0361765ab3bea4eae6d970176032dc6f4ce2df3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e0361765ab3bea4eae6d970176...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon Aug 1 12:18:51 2016 +0300
comctl32/listview: Remove redundant check in LVM_DELETECOLUMN handler.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comctl32/listview.c | 4 ++-- dlls/comctl32/tests/listview.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index a32c594..6ab360b 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -5621,8 +5621,8 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn)
TRACE("nColumn=%d\n", nColumn);
- if (nColumn < 0 || DPA_GetPtrCount(infoPtr->hdpaColumns) == 0 - || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE; + if (nColumn < 0 || nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) + return FALSE;
/* While the MSDN specifically says that column zero should not be deleted, what actually happens is that the column itself is deleted but no items or subitems diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 8214d7b..97f611f 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -1420,6 +1420,12 @@ static void test_columns(void) 10, 10, 100, 200, hwndparent, NULL, NULL, NULL); ok(hwnd != NULL, "failed to create listview window\n");
+ rc = SendMessageA(hwnd, LVM_DELETECOLUMN, -1, 0); + ok(!rc, "got %d\n", rc); + + rc = SendMessageA(hwnd, LVM_DELETECOLUMN, 0, 0); + ok(!rc, "got %d\n", rc); + /* Add a column with no mask */ memset(&column, 0xcc, sizeof(column)); column.mask = 0;