user32/edit: Fix EM_SETWORDBREAKPROC return value.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8247c13aae
commit
6aa853ae39
|
@ -2982,6 +2982,37 @@ static void test_EM_GETLINE(void)
|
|||
}
|
||||
}
|
||||
|
||||
static int CALLBACK test_wordbreak_procA(char *text, int current, int length, int code)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void test_wordbreak_proc(void)
|
||||
{
|
||||
EDITWORDBREAKPROCA proc;
|
||||
LRESULT ret;
|
||||
HWND hwnd;
|
||||
|
||||
hwnd = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
|
||||
|
||||
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
|
||||
ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
|
||||
|
||||
ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)test_wordbreak_procA);
|
||||
ok(ret == 1, "Unexpected return value %ld.\n", ret);
|
||||
|
||||
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
|
||||
ok(proc == test_wordbreak_procA, "Unexpected wordbreak proc %p.\n", proc);
|
||||
|
||||
ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, 0);
|
||||
ok(ret == 1, "Unexpected return value %ld.\n", ret);
|
||||
|
||||
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
|
||||
ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
START_TEST(edit)
|
||||
{
|
||||
ULONG_PTR ctx_cookie;
|
||||
|
@ -3022,6 +3053,7 @@ START_TEST(edit)
|
|||
test_EM_GETHANDLE();
|
||||
test_paste();
|
||||
test_EM_GETLINE();
|
||||
test_wordbreak_proc();
|
||||
|
||||
UnregisterWindowClasses();
|
||||
|
||||
|
|
|
@ -4839,6 +4839,7 @@ LRESULT EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, B
|
|||
|
||||
case EM_SETWORDBREAKPROC:
|
||||
EDIT_EM_SetWordBreakProc(es, (void *)lParam);
|
||||
result = 1;
|
||||
break;
|
||||
|
||||
case EM_GETWORDBREAKPROC:
|
||||
|
|
|
@ -2999,6 +2999,37 @@ static void test_EM_GETLINE(void)
|
|||
}
|
||||
}
|
||||
|
||||
static int CALLBACK test_wordbreak_procA(char *text, int current, int length, int code)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void test_wordbreak_proc(void)
|
||||
{
|
||||
EDITWORDBREAKPROCA proc;
|
||||
LRESULT ret;
|
||||
HWND hwnd;
|
||||
|
||||
hwnd = create_editcontrol(ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0);
|
||||
|
||||
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
|
||||
ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
|
||||
|
||||
ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)test_wordbreak_procA);
|
||||
ok(ret == 1, "Unexpected return value %ld.\n", ret);
|
||||
|
||||
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
|
||||
ok(proc == test_wordbreak_procA, "Unexpected wordbreak proc %p.\n", proc);
|
||||
|
||||
ret = SendMessageA(hwnd, EM_SETWORDBREAKPROC, 0, 0);
|
||||
ok(ret == 1, "Unexpected return value %ld.\n", ret);
|
||||
|
||||
proc = (void *)SendMessageA(hwnd, EM_GETWORDBREAKPROC, 0, 0);
|
||||
ok(proc == NULL, "Unexpected wordbreak proc %p.\n", proc);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
}
|
||||
|
||||
START_TEST(edit)
|
||||
{
|
||||
BOOL b;
|
||||
|
@ -3034,6 +3065,7 @@ START_TEST(edit)
|
|||
test_EM_GETHANDLE();
|
||||
test_paste();
|
||||
test_EM_GETLINE();
|
||||
test_wordbreak_proc();
|
||||
|
||||
UnregisterWindowClasses();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue