listbox: ownerdraw fix
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Mon Nov 17 09:47:38 CST 2003
On Mon, Nov 17, 2003 at 10:33:33AM -0500, Dimitrie O. Paun wrote:
> On November 17, 2003 10:16 am, Huw D M Davies wrote:
> > + if (LISTBOX_GetItemRect( descr, index, &rect ) == 1)
>
> OK, I very sorry to nick pick so much, but this test is not
> only strange in C, but it's a bit dangerous as well, since
> in the future LISTBOX_GetItemRect may return something >1
> for TRUE, and things will break silently. Why not the more
> common:
> if (LISTBOX_GetItemRect( descr, index, &rect ))
I guess that's because there are several other calls to
LISTBOX_GetItemRect that have the same syntax. Note that
LISTBOX_GetItemRect can return -1 on error.
Huw.
--
Huw Davies
huw at codeweavers.com
More information about the wine-devel
mailing list