comctl32/listview: Simplify a couple of conditions that are using LVFI_PARTIAL.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-05-22 00:09:41 +03:00 committed by Alexandre Julliard
parent d05b351fe0
commit 65d64e15c8
1 changed files with 3 additions and 5 deletions

View File

@ -6344,8 +6344,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
if (!lpFindInfo || nItem < 0) return -1; if (!lpFindInfo || nItem < 0) return -1;
lvItem.mask = 0; lvItem.mask = 0;
if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) || if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL | LVFI_SUBSTRING))
lpFindInfo->flags & LVFI_SUBSTRING)
{ {
lvItem.mask |= LVIF_TEXT; lvItem.mask |= LVIF_TEXT;
lvItem.pszText = szDispText; lvItem.pszText = szDispText;
@ -6469,14 +6468,13 @@ again:
static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart, static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart,
const LVFINDINFOA *lpFindInfo) const LVFINDINFOA *lpFindInfo)
{ {
BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) ||
lpFindInfo->flags & LVFI_SUBSTRING;
LVFINDINFOW fiw; LVFINDINFOW fiw;
INT res; INT res;
LPWSTR strW = NULL; LPWSTR strW = NULL;
memcpy(&fiw, lpFindInfo, sizeof(fiw)); memcpy(&fiw, lpFindInfo, sizeof(fiw));
if (hasText) fiw.psz = strW = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE); if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL | LVFI_SUBSTRING))
fiw.psz = strW = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
res = LISTVIEW_FindItemW(infoPtr, nStart, &fiw); res = LISTVIEW_FindItemW(infoPtr, nStart, &fiw);
textfreeT(strW, FALSE); textfreeT(strW, FALSE);
return res; return res;