Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- 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 2137ef8..a49a26c 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)) { SetLastError(ERROR_SETCOUNT_ON_BAD_LB); return LB_ERR; @@ -2518,6 +2518,9 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc ) if (descr->style & LBS_OWNERDRAWVARIABLE) descr->style |= LBS_NOINTEGRALHEIGHT; descr->item_height = LISTBOX_SetFont( descr, 0 );
+ if ((descr->style & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_SORT)) != LBS_OWNERDRAWFIXED) + descr->style &= ~LBS_NODATA; + if (descr->style & LBS_OWNERDRAWFIXED) { if( descr->lphc && (descr->lphc->dwStyle & CBS_DROPDOWN))
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/listbox.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index c8bd148..97f275a 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1757,7 +1757,7 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count ) { LRESULT ret;
- if (HAS_STRINGS(descr)) + if (!(descr->style & LBS_NODATA)) { SetLastError(ERROR_SETCOUNT_ON_BAD_LB); return LB_ERR; @@ -2523,6 +2523,9 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc ) if (descr->style & LBS_OWNERDRAWVARIABLE) descr->style |= LBS_NOINTEGRALHEIGHT; descr->item_height = LISTBOX_SetFont( descr, 0 );
+ if ((descr->style & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE | LBS_HASSTRINGS | LBS_SORT)) != LBS_OWNERDRAWFIXED) + descr->style &= ~LBS_NODATA; + if (descr->style & LBS_OWNERDRAWFIXED) { if( descr->lphc && (descr->lphc->dwStyle & CBS_DROPDOWN))
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/comctl32/tests/listbox.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index c9d13a8..16efa60 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -1753,6 +1753,13 @@ static void test_set_count( void ) ok( !IsRectEmpty( &r ), "got empty rect\n");
DestroyWindow( listbox ); + + listbox = create_listbox( LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE, parent ); + + ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); + ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret ); + + DestroyWindow( listbox ); DestroyWindow( parent ); }
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=42270
Your paranoid android.
=== wvistau64 (32 bit Windows report) ===
comctl32: listbox.c:1129: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_zh_CN (32 bit Windows report) ===
comctl32: listbox.c:1129: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_fr (32 bit Windows report) ===
comctl32: listbox.c:1129: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_he (32 bit Windows report) ===
comctl32: listbox.c:1129: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64 (64 bit Windows report) ===
comctl32: listbox.c:1129: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/user32/tests/listbox.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index dfa8de7..4d9e70f 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1711,6 +1711,13 @@ static void test_set_count( void ) ok( !IsRectEmpty( &r ), "got empty rect\n");
DestroyWindow( listbox ); + + listbox = create_listbox( LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE, parent ); + + ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 ); + ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret ); + + DestroyWindow( listbox ); DestroyWindow( parent ); }
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=42271
Your paranoid android.
=== wvistau64 (32 bit Windows report) ===
user32: listbox.c:844: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with 7 entries, expected > 7 listbox.c:1079: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_zh_CN (32 bit Windows report) ===
user32: listbox.c:844: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with 7 entries, expected > 7 listbox.c:1079: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_fr (32 bit Windows report) ===
user32: listbox.c:844: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with 7 entries, expected > 7 listbox.c:1079: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64_he (32 bit Windows report) ===
user32: listbox.c:844: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with 7 entries, expected > 7 listbox.c:1079: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18
=== wvistau64 (64 bit Windows report) ===
user32: listbox.c:844: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY, *) filled with 7 entries, expected > 7 listbox.c:1079: Test failed: SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err 18