riched20: Don't append '\r' to the last paragraph in EM_GETTEXTEX.
This commit is contained in:
parent
5c23aa19dc
commit
0dec18a3d6
|
@ -1956,7 +1956,7 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
|||
DWORD flags = 0;
|
||||
|
||||
buflen = ME_GetTextW(editor, buffer, nStart, nCount, ex->flags & GT_USECRLF);
|
||||
rc = WideCharToMultiByte(ex->codepage, flags, buffer, buflen, (LPSTR)lParam, ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar);
|
||||
rc = WideCharToMultiByte(ex->codepage, flags, buffer, -1, (LPSTR)lParam, ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar);
|
||||
|
||||
HeapFree(GetProcessHeap(),0,buffer);
|
||||
return rc;
|
||||
|
@ -2502,6 +2502,10 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
|
|||
|
||||
if (item->member.run.nFlags & MERF_ENDPARA)
|
||||
{
|
||||
if (!ME_FindItemFwd(item, diRun))
|
||||
/* No '\r' is appended to the last paragraph. */
|
||||
nLen = 0;
|
||||
else {
|
||||
*buffer = '\r';
|
||||
if (bCRLF)
|
||||
{
|
||||
|
@ -2513,6 +2517,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
|
|||
if (editor->bEmulateVersion10)
|
||||
nChars--;
|
||||
}
|
||||
}
|
||||
else
|
||||
CopyMemory(buffer, item->member.run.strText->szData, sizeof(WCHAR)*nLen);
|
||||
nChars -= nLen;
|
||||
|
|
|
@ -494,7 +494,6 @@ static void test_TM_PLAINTEXT()
|
|||
DestroyWindow(hwndRichEdit);
|
||||
}
|
||||
|
||||
/* FIXME: Extra '\r' appended at end of gotten text*/
|
||||
static void test_WM_GETTEXT()
|
||||
{
|
||||
HWND hwndRichEdit = new_richedit(NULL);
|
||||
|
@ -505,11 +504,9 @@ static void test_WM_GETTEXT()
|
|||
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text);
|
||||
SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
|
||||
result = strcmp(buffer,text);
|
||||
todo_wine{
|
||||
ok(result == 0,
|
||||
"WM_GETTEXT: settext and gettext differ. strcmp: %d\n", result);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: need to test unimplemented options and robustly test wparam */
|
||||
static void test_EM_SETOPTIONS()
|
||||
|
|
Loading…
Reference in New Issue