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

Huw Davies huw at codeweavers.com
Mon Feb 11 09:35:47 CST 2019


On Mon, Feb 11, 2019 at 05:29:58PM +0200, Gabriel Iv─âncescu wrote:
> Ok, I have a question on how to proceed now, after looking through and
> finishing the rework.
> 
> DeleteItem saves the item data & string at the beginning, *before*
> ResetContent. It has to.
> 
> If I special-case LBS_NODATA inside of it, I'll have to do it *twice* (one
> before saving, one after ResetContent), or duplicate ResetContent, which is
> pretty ugly.
> 
> So, with this in mind, should I still special case it inside of DeleteItem
> instead of RemoveItem? (or a helper inside RemoveItem, as per InsertItem).
> 
> This will also fix the O(n) issue. And in the end there will be the same
> amount of checks in the code. I think this is how I should proceed but I
> want to be sure before I send it in later if you don't want it.
> 
> Summary: there will be one check in RemoveItem's helper (like InsertItem)
> and one in ResetContent. Instead of having two checks in DeleteItem (and the
> O(n) thing).

It's going to be easier to review some actual code.  So do it in the way
you think best follows the spirit of what I was asking and we can take it
from there.

Huw.



More information about the wine-devel mailing list