Commit 88a3a584 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/listview: Use wcsnicmp() instead of a local helper.

parent 077fd389
...@@ -539,12 +539,6 @@ static inline int textcmpWT(LPCWSTR aw, LPCWSTR bt, BOOL isW) ...@@ -539,12 +539,6 @@ static inline int textcmpWT(LPCWSTR aw, LPCWSTR bt, BOOL isW)
return 1; return 1;
} }
static inline int lstrncmpiW(LPCWSTR s1, LPCWSTR s2, int n)
{
n = min(min(n, lstrlenW(s1)), lstrlenW(s2));
return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, s1, n, s2, n) - CSTR_EQUAL;
}
/******** Debugging functions *****************************************/ /******** Debugging functions *****************************************/
...@@ -1953,7 +1947,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L ...@@ -1953,7 +1947,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
item.cchTextMax = MAX_PATH; item.cchTextMax = MAX_PATH;
if (!LISTVIEW_GetItemW(infoPtr, &item)) return 0; if (!LISTVIEW_GetItemW(infoPtr, &item)) return 0;
if (!lstrncmpiW(item.pszText, infoPtr->szSearchParam, infoPtr->nSearchParamLength)) if (!wcsnicmp(item.pszText, infoPtr->szSearchParam, infoPtr->nSearchParamLength))
{ {
nItem = i; nItem = i;
break; break;
...@@ -1961,7 +1955,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L ...@@ -1961,7 +1955,7 @@ static INT LISTVIEW_ProcessLetterKeys(LISTVIEW_INFO *infoPtr, WPARAM charCode, L
/* this is used to find first char match when search string is not available yet, /* this is used to find first char match when search string is not available yet,
otherwise every WM_CHAR will search to next item by first char, ignoring that we're otherwise every WM_CHAR will search to next item by first char, ignoring that we're
already waiting for user to complete a string */ already waiting for user to complete a string */
else if (nItem == -1 && infoPtr->nSearchParamLength == 1 && !lstrncmpiW(item.pszText, infoPtr->szSearchParam, 1)) else if (nItem == -1 && infoPtr->nSearchParamLength == 1 && !wcsnicmp(item.pszText, infoPtr->szSearchParam, 1))
{ {
/* this would work but we must keep looking for a longer match */ /* this would work but we must keep looking for a longer match */
nItem = i; nItem = i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment