richedit: Fixed initial word wrap setting when emulating 1.0.

This commit is contained in:
Dylan Smith 2008-10-26 23:38:15 -04:00 committed by Alexandre Julliard
parent 9b4c821185
commit 4c28a5bcfb
2 changed files with 5 additions and 3 deletions

View file

@ -4148,7 +4148,9 @@ LRESULT WINAPI RichEdit10ANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
{
ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(hWnd, 0);
TRACE("Emulating version 1.0 (hWnd=%p)\n", hWnd);
editor->bEmulateVersion10 = TRUE;
editor->bWordWrap = (GetWindowLongW(hWnd, GWL_STYLE) & ES_AUTOHSCROLL) ? FALSE : TRUE;
editor->pBuffer->pLast->member.para.nCharOfs = 2;
assert(editor->pBuffer->pLast->prev->type == diRun);
assert(editor->pBuffer->pLast->prev->member.run.nFlags & MERF_ENDPARA);

View file

@ -849,13 +849,13 @@ static void test_word_wrap(void)
res = SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) text);
ok(res, "WM_SETTEXT failed.\n");
pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
todo_wine ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos);
ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos);
lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0);
todo_wine ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines);
ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines);
SetWindowLong(hwnd, GWL_STYLE, dwCommonStyle|WS_HSCROLL|ES_AUTOHSCROLL);
pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point);
todo_wine ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos);
ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos);
DestroyWindow(hwnd);
hwnd = CreateWindow(RICHEDIT_CLASS10A, NULL, dwCommonStyle|ES_AUTOHSCROLL,