comctl32/listview: Use case-insensitive compare in LVM_FINDITEM.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
f6802b7a31
commit
ab81945d65
|
@ -1,7 +1,7 @@
|
|||
EXTRADEFS = -D_COMCTL32_
|
||||
MODULE = comctl32.dll
|
||||
IMPORTLIB = comctl32
|
||||
IMPORTS = uuid user32 gdi32 advapi32 usp10 imm32
|
||||
IMPORTS = uuid user32 gdi32 advapi32 usp10 imm32 kernelbase
|
||||
DELAYIMPORTS = winmm uxtheme
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
|
|
|
@ -140,6 +140,7 @@
|
|||
#include "commctrl.h"
|
||||
#include "comctl32.h"
|
||||
#include "uxtheme.h"
|
||||
#include "shlwapi.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
|
@ -6313,6 +6314,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
|
|||
INT nItem = nStart + 1, nLast = infoPtr->nItemCount, nNearestItem = -1;
|
||||
ULONG xdist, ydist, dist, mindist = 0x7fffffff;
|
||||
POINT Position, Destination;
|
||||
int search_len = 0;
|
||||
LVITEMW lvItem;
|
||||
|
||||
/* Search in virtual listviews should be done by application, not by
|
||||
|
@ -6378,6 +6380,9 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
|
|||
|
||||
nItem = bNearest ? -1 : nStart + 1;
|
||||
|
||||
if (lpFindInfo->flags & (LVFI_PARTIAL | LVFI_SUBSTRING))
|
||||
search_len = lstrlenW(lpFindInfo->psz);
|
||||
|
||||
again:
|
||||
for (; nItem < nLast; nItem++)
|
||||
{
|
||||
|
@ -6398,12 +6403,11 @@ again:
|
|||
{
|
||||
if (lpFindInfo->flags & (LVFI_PARTIAL | LVFI_SUBSTRING))
|
||||
{
|
||||
WCHAR *p = wcsstr(lvItem.pszText, lpFindInfo->psz);
|
||||
if (!p || p != lvItem.pszText) continue;
|
||||
if (StrCmpNIW(lvItem.pszText, lpFindInfo->psz, search_len)) continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lstrcmpW(lvItem.pszText, lpFindInfo->psz) != 0) continue;
|
||||
if (StrCmpIW(lvItem.pszText, lpFindInfo->psz)) continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5366,6 +5366,19 @@ static void test_finditem(void)
|
|||
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
|
||||
expect(0, r);
|
||||
|
||||
/* Case sensitivity. */
|
||||
strcpy(f, "Foo");
|
||||
fi.flags = LVFI_STRING;
|
||||
fi.psz = f;
|
||||
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
|
||||
ok(!r, "Unexpected item index %d.\n", r);
|
||||
|
||||
strcpy(f, "F");
|
||||
fi.flags = LVFI_SUBSTRING;
|
||||
fi.psz = f;
|
||||
r = SendMessageA(hwnd, LVM_FINDITEMA, -1, (LPARAM)&fi);
|
||||
ok(!r, "Unexpected item index %d.\n", r);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue