[PATCH v3 8/8] comctl32/listbox: Make LBS_NODATA listboxes error on any attempt to find a value

Nikolay Sivov nsivov at codeweavers.com
Sat Nov 10 15:38:24 CST 2018


On 11/8/18 2:39 PM, Gabriel Ivăncescu wrote:

> @@ -919,6 +919,9 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
>       }
>       else
>       {
> +        if (descr->style & LBS_NODATA)
> +            return LB_ERR;
> +
>           if (exact && (descr->style & LBS_SORT))
>               /* If sorted, use a WM_COMPAREITEM binary search */
>               return LISTBOX_FindStringPos( descr, str, TRUE );
> @@ -2450,7 +2453,7 @@ static LRESULT LISTBOX_HandleChar( LB_DESCR *descr, WCHAR charW )
>                                   (LPARAM)descr->self );
>           if (caret == -2) return 0;
>       }
> -    if (caret == -1)
> +    if (caret == -1 && !(descr->style & LBS_NODATA))
>           caret = LISTBOX_FindString( descr, descr->focus_item, str, FALSE);
>       if (caret != -1)
>       {

Does it have to be deep in message handler? Can we skip right away if we 
have to?

Also same issue, these are easily separable changes.




More information about the wine-devel mailing list