[PATCH v3 4/8] comctl32/listbox: Make SetCount fail if LBS_NODATA is not set

Gabriel Ivăncescu gabrielopcode at gmail.com
Sun Nov 11 04:01:22 CST 2018


On Sat, Nov 10, 2018 at 11:46 PM Nikolay Sivov <nsivov at codeweavers.com> wrote:
>
> On 11/8/18 2:39 PM, Gabriel Ivăncescu wrote:
>
> > Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
> > ---
> >   dlls/comctl32/listbox.c       | 5 ++++-
> >   dlls/comctl32/tests/listbox.c | 2 +-
> >   2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
> > index 2137ef8..0a7c341 100644
> > --- a/dlls/comctl32/listbox.c
> > +++ b/dlls/comctl32/listbox.c
> > @@ -1752,7 +1752,7 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count )
> >   {
> >       LRESULT ret;
> >
> > -    if (HAS_STRINGS(descr))
> > +    if (!(descr->style & LBS_NODATA))
>
> I think HAS_STRINGS should consider LBS_NODATA instead.
>

How is that going to work? Consider these listboxes:

(1) LBS_OWNERDRAWFIXED
(2) LBS_OWNERDRAWFIXED | LBS_HASSTRINGS
(3) LBS_OWNERDRAWFIXED | LBS_NODATA
(4) LBS_OWNERDRAWFIXED | LBS_NODATA | LBS_HASSTRINGS

SetCount must only succeed with (3). For (4) the clear of LBS_NODATA
is enough, since LBS_HASSTRINGS overrides and disables it.

I don't see how adding anything to HAS_STRINGS will solve the issue of
(1) being a distinct listbox with no strings and without LBS_NODATA. I
mean, it doesn't have strings, but it should also fail in SetCount.

Of course, I can separate the patch that clears LBS_NODATA and place
it before this patch, if you want.



More information about the wine-devel mailing list