[PATCH v4 2/4] comctl32/listbox: Move the item data removal into a separate function

Huw Davies huw at codeweavers.com
Tue Feb 19 04:15:43 CST 2019


On Mon, Feb 18, 2019 at 03:47:52PM +0200, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> ---
>  dlls/comctl32/listbox.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
> index 330d3ae..214bfb0 100644
> --- a/dlls/comctl32/listbox.c
> +++ b/dlls/comctl32/listbox.c
> @@ -126,6 +126,7 @@ typedef enum
>  static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE;
>  
>  static LRESULT LISTBOX_GetItemRect( const LB_DESCR *descr, INT index, RECT *rect );
> +static void LISTBOX_DeleteItem( LB_DESCR *descr, INT index );
>  
>  static BOOL resize_storage(LB_DESCR *descr, UINT items_size)
>  {
> @@ -208,6 +209,14 @@ static void insert_item_data(LB_DESCR *descr, INT index, WCHAR *str, ULONG_PTR d
>      }
>  }
>  
> +static void remove_item_data(LB_DESCR *descr, INT index)
> +{
> +    LISTBOX_DeleteItem(descr, index);

Similarly let's leave LISTBOX_DeleteItem in RemoveItem().

> +    if (index < descr->nb_items)
> +        RtlMoveMemory(&descr->items[index], &descr->items[index + 1],
> +                      (descr->nb_items - index) * sizeof(LB_ITEMDATA));
> +}
> +
>  /***********************************************************************
>   *           LISTBOX_GetCurrentPageSize
>   *



More information about the wine-devel mailing list