[PATCH v4 5/7] comctl32/listbox: Use a helper to retrieve item string by index

Huw Davies huw at codeweavers.com
Wed Feb 13 03:50:15 CST 2019


On Tue, Feb 12, 2019 at 03:47:01PM +0200, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
> 
> v4: Dumb mistake with get_item_string, sorry for noise.
> 
> I've left FindStringPos alone because I'm not 100% sure if a listbox with
> strings is allowed to have a NULL str (which would give a different code
> path than currently, if I were to check for NULL from get_item_string
> instead). LISTBOX_lstrcmpiW ends up using CompareStringW which does check
> for NULL, so I'm not entirely certain about it.

_InsertString inserts an empty string in this case, but I don't find
any tests for this.  Could you add one?

There are also many over places (e.g. the 2nd half of _PaintItem) that
could use this helper.  The goal is to have all reads of ->str go through
this helper, even in cases where the code is inside a HAS_STRINGS() block.

Huw.



More information about the wine-devel mailing list