Avoid converting nonexistent text from A->W.

This commit is contained in:
Gerard Patel 2002-01-29 03:08:24 +00:00 committed by Alexandre Julliard
parent 6f7fc50424
commit 3dbbb0b297
1 changed files with 3 additions and 2 deletions

View File

@ -4583,13 +4583,14 @@ static LRESULT LISTVIEW_FindItemW(HWND hwnd, INT nStart,
static LRESULT LISTVIEW_FindItemA(HWND hwnd, INT nStart,
LPLVFINDINFOA lpFindInfo)
{
BOOL hasText = lpFindInfo->flags & (LVFI_STRING | LVFI_PARTIAL);
LVFINDINFOW fiw;
LRESULT res;
memcpy(&fiw, lpFindInfo, sizeof(fiw));
fiw.psz = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
if (hasText) fiw.psz = textdupTtoW((LPCWSTR)lpFindInfo->psz, FALSE);
res = LISTVIEW_FindItemW(hwnd, nStart, &fiw);
textfreeT((LPWSTR)fiw.psz, FALSE);
if (hasText) textfreeT((LPWSTR)fiw.psz, FALSE);
return res;
}