[PATCH v3 3/4] comctl32/listbox: Implement LBS_NODATA for single-selection listboxes

Nikolay Sivov nsivov at codeweavers.com
Mon Feb 18 06:19:18 CST 2019


On 2/18/19 3:09 PM, Gabriel Ivăncescu wrote:

> +static BOOL is_singlesel_NODATA(const LB_DESCR *descr)
> +{
> +    return (descr->style & (LBS_NODATA | LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == LBS_NODATA;
> +}
> +
> +static BOOL is_multisel_NODATA(const LB_DESCR *descr)
> +{
> +    return (descr->style & LBS_NODATA) && (descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL));
> +}
> +

This has to be consistent with existing IS_MULTISELECT(), both for 
naming and usage throughout the code.

Could the same be achieved with IS_MULTISELECT() and direct style check 
for LBS_NODATA?

Shortcuts with is_singlesel_NODATA() also seem avoidable, if we don't need to allocate anything in this case, can we just check for descr->items != NULL?

That's basically what I was trying to suggest since first version of such helpers appeared.




More information about the wine-devel mailing list