Commit e5f5dc60 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Removed some unnecessary SendMessage calls to itself.

parent c7c2ff1f
...@@ -1566,10 +1566,8 @@ void ME_SendSelChange(ME_TextEditor *editor) ...@@ -1566,10 +1566,8 @@ void ME_SendSelChange(ME_TextEditor *editor)
if (!(editor->nEventMask & ENM_SELCHANGE)) if (!(editor->nEventMask & ENM_SELCHANGE))
return; return;
sc.nmhdr.hwndFrom = editor->hWnd;
sc.nmhdr.idFrom = GetWindowLongW(editor->hWnd, GWLP_ID);
sc.nmhdr.code = EN_SELCHANGE; sc.nmhdr.code = EN_SELCHANGE;
SendMessageW(editor->hWnd, EM_EXGETSEL, 0, (LPARAM)&sc.chrg); ME_GetSelection(editor, &sc.chrg.cpMin, &sc.chrg.cpMax);
sc.seltyp = SEL_EMPTY; sc.seltyp = SEL_EMPTY;
if (sc.chrg.cpMin != sc.chrg.cpMax) if (sc.chrg.cpMin != sc.chrg.cpMax)
sc.seltyp |= SEL_TEXT; sc.seltyp |= SEL_TEXT;
......
...@@ -1426,7 +1426,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre ...@@ -1426,7 +1426,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
ME_DisplayItem *para_item; ME_DisplayItem *para_item;
style = editor->pBuffer->pDefaultStyle; style = editor->pBuffer->pDefaultStyle;
ME_AddRefStyle(style); ME_AddRefStyle(style);
SendMessageA(editor->hWnd, EM_SETSEL, 0, 0); ME_SetSelection(editor, 0, 0);
ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor), FALSE); ME_InternalDeleteText(editor, 0, ME_GetTextLength(editor), FALSE);
from = to = 0; from = to = 0;
ME_ClearTempStyle(editor); ME_ClearTempStyle(editor);
...@@ -1559,7 +1559,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre ...@@ -1559,7 +1559,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
ME_GetSelection(editor, &to, &to2); ME_GetSelection(editor, &to, &to2);
/* put the cursor at the top */ /* put the cursor at the top */
if (!(format & SFF_SELECTION)) if (!(format & SFF_SELECTION))
SendMessageA(editor->hWnd, EM_SETSEL, 0, 0); ME_SetSelection(editor, 0, 0);
} }
/* Restore saved undo mode */ /* Restore saved undo mode */
...@@ -4063,7 +4063,12 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ...@@ -4063,7 +4063,12 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
LRESULT ret; LRESULT ret;
int mask = 0; int mask = 0;
int changes = 0; int changes = 0;
ret = RichEditWndProc_common(hWnd, WM_GETTEXTLENGTH, 0, 0, unicode); GETTEXTLENGTHEX how;
/* CR/LF conversion required in 2.0 mode, verbatim in 1.0 mode */
how.flags = GTL_CLOSE | (editor->bEmulateVersion10 ? 0 : GTL_USECRLF) | GTL_NUMCHARS;
how.codepage = unicode ? 1200 : CP_ACP;
ret = ME_GetTextLengthEx(editor, &how);
if (!ret) if (!ret)
{ {
/*Check for valid wParam*/ /*Check for valid wParam*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment