Alex Villacís Lasso : riched20: EM_SETCHARFORMAT must return 1 on success, not 0.
Module: wine Branch: master Commit: fa5230fb54a2f0c57acf5ce800f6279b5b64b2aa URL: http://source.winehq.org/git/wine.git/?a=commit;h=fa5230fb54a2f0c57acf5ce800... Author: Alex Villacís Lasso <a_villacis(a)palosanto.com> Date: Tue Sep 25 15:11:14 2007 -0500 riched20: EM_SETCHARFORMAT must return 1 on success, not 0. --- dlls/riched20/editor.c | 2 +- dlls/riched20/tests/editor.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index a10c954..f90c353 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1748,7 +1748,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_CommitUndo(editor); if (bRepaint) ME_RewrapRepaint(editor); - return 0; + return 1; } case EM_GETCHARFORMAT: { diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 1c564ec..7a092c3 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -366,7 +366,8 @@ static void test_EM_SETTEXTMODE(void) /*EM_SETCHARFORMAT is not yet fully implemented for all WPARAMs in wine; however, SCF_ALL has been implemented*/ - SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "wine"); /*Select the string "wine"*/ @@ -379,7 +380,8 @@ static void test_EM_SETTEXTMODE(void) /*Reset the formatting to default*/ cf2.dwEffects = CFE_ITALIC^cf2.dwEffects; - SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); /*Clear the text in the control*/ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) ""); @@ -472,6 +474,7 @@ static void test_TM_PLAINTEXT(void) HWND hwndRichEdit = new_richedit(NULL); CHARFORMAT2 cf2, cf2test; CHARRANGE cr; + int rc = 0; /*Switch to plain text mode*/ @@ -494,7 +497,10 @@ static void test_TM_PLAINTEXT(void) cf2.dwMask = CFM_BOLD | cf2.dwMask; cf2.dwEffects = CFE_BOLD ^ cf2.dwEffects; - SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_SELECTION, (LPARAM) &cf2); + todo_wine { + ok(rc == 0, "EM_SETCHARFORMAT returned %d instead of 0\n", rc); + } /*Get the formatting of those characters*/ @@ -534,7 +540,8 @@ static void test_TM_PLAINTEXT(void) SendMessage(hwndRichEdit, EM_GETCHARFORMAT, (WPARAM) SCF_DEFAULT, (LPARAM) &cf2); cf2.dwMask |= CFM_ITALIC; cf2.dwEffects ^= CFE_ITALIC; - SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + rc = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + ok(rc == 1, "EM_SETCHARFORMAT returned %d instead of 1\n", rc); /*Set the text in the control to "wine", which will be bold and italicized*/ @@ -1472,6 +1479,8 @@ static void test_EM_GETMODIFY(void) cf2.dwMask = CFM_ITALIC | cf2.dwMask; cf2.dwEffects = CFE_ITALIC ^ cf2.dwEffects; SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + result = SendMessage(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) &cf2); + ok(result == 1, "EM_SETCHARFORMAT returned %ld instead of 1\n", result); result = SendMessage(hwndRichEdit, EM_GETMODIFY, 0, 0); ok (result != 0, "EM_GETMODIFY returned zero, instead of non-zero for EM_SETCHARFORMAT\n");
participants (1)
-
Alexandre Julliard