[PATCH v2 7/8] comctl32/listbox: Make LBS_NODATA listboxes error on any attempt to find a value
Gabriel Ivăncescu
gabrielopcode at gmail.com
Tue Nov 6 05:30:59 CST 2018
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
This is what Windows does (see next patch for tests).
dlls/comctl32/listbox.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index ab01430..7747c33 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -919,6 +919,9 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
}
else
{
+ if (descr->style & LBS_NODATA)
+ return LB_ERR;
+
if (exact && (descr->style & LBS_SORT))
/* If sorted, use a WM_COMPAREITEM binary search */
return LISTBOX_FindStringPos( descr, str, TRUE );
@@ -2450,7 +2453,7 @@ static LRESULT LISTBOX_HandleChar( LB_DESCR *descr, WCHAR charW )
(LPARAM)descr->self );
if (caret == -2) return 0;
}
- if (caret == -1)
+ if (caret == -1 && !(descr->style & LBS_NODATA))
caret = LISTBOX_FindString( descr, descr->focus_item, str, FALSE);
if (caret != -1)
{
--
2.19.1
More information about the wine-devel
mailing list