mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 17:27:18 +00:00
Allow NULL parameter for WM_SETTEXT in RichEdit.
This commit is contained in:
parent
b676b62240
commit
b5a0433231
|
@ -1180,12 +1180,21 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
}
|
}
|
||||||
case WM_SETTEXT:
|
case WM_SETTEXT:
|
||||||
{
|
{
|
||||||
LPWSTR wszText = ME_ToUnicode(hWnd, (void *)lParam);
|
|
||||||
TRACE("WM_SETTEXT - %s\n", (char *)(wszText)); /* debugstr_w() */
|
|
||||||
ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor));
|
ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor));
|
||||||
/* uses default style! */
|
if (lParam)
|
||||||
ME_InsertTextFromCursor(editor, 0, wszText, -1, editor->pBuffer->pDefaultStyle);
|
{
|
||||||
ME_EndToUnicode(hWnd, wszText);
|
LPWSTR wszText = ME_ToUnicode(hWnd, (void *)lParam);
|
||||||
|
TRACE("WM_SETTEXT lParam==%lx\n",lParam);
|
||||||
|
TRACE("WM_SETTEXT - %s\n", debugstr_w(wszText)); /* debugstr_w() */
|
||||||
|
if (lstrlenW(wszText) > 0)
|
||||||
|
{
|
||||||
|
/* uses default style! */
|
||||||
|
ME_InsertTextFromCursor(editor, 0, wszText, -1, editor->pBuffer->pDefaultStyle);
|
||||||
|
}
|
||||||
|
ME_EndToUnicode(hWnd, wszText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
TRACE("WM_SETTEXT - NULL\n");
|
||||||
ME_CommitUndo(editor);
|
ME_CommitUndo(editor);
|
||||||
ME_EmptyUndoStack(editor);
|
ME_EmptyUndoStack(editor);
|
||||||
ME_UpdateRepaint(editor);
|
ME_UpdateRepaint(editor);
|
||||||
|
|
Loading…
Reference in a new issue