[PATCH 3/3] comctl32/listview: Simplify a couple of conditions that are using LVFI_PARTIAL
Nikolay Sivov
nsivov at codeweavers.com
Sun May 21 16:09:41 CDT 2017
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/comctl32/listview.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 35c2453094..459bb38c1d 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -6344,8 +6344,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
if (!lpFindInfo || nItem < 0) return -1;
lvItem.mask = 0;
- if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) ||
- lpFindInfo->flags & LVFI_SUBSTRING)
+ if (lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL | LVFI_SUBSTRING))
{
lvItem.mask |= LVIF_TEXT;
lvItem.pszText = szDispText;
@@ -6469,14 +6468,13 @@ again:
static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart,
const LVFINDINFOA *lpFindInfo)
{
- BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL) ||
- lpFindInfo->flags & LVFI_SUBSTRING;
LVFINDINFOW fiw;
INT res;
LPWSTR strW = NULL;
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);
textfreeT(strW, FALSE);
return res;
--
2.11.0
More information about the wine-patches
mailing list