richedit: Use ITextHost interface in ME_LinkNotify.

Using the ITextHost interface allows this notification to be received
for windowless richedit controls.  Windowed richedit conrols have an
ITextHost implementation that will fill in hwndFrom and idFrom, but
these should probably be initialized to 0 for windowless richedit
controls.
oldstable
Dylan Smith 2009-09-28 03:44:19 -04:00 committed by Alexandre Julliard
parent bc4633a25b
commit 0342ab0df1
3 changed files with 7 additions and 3 deletions

View File

@ -1537,6 +1537,8 @@ void ME_SendSelChange(ME_TextEditor *editor)
if (!(editor->nEventMask & ENM_SELCHANGE))
return;
sc.nmhdr.hwndFrom = NULL;
sc.nmhdr.idFrom = 0;
sc.nmhdr.code = EN_SELCHANGE;
ME_GetSelectionOfs(editor, &sc.chrg.cpMin, &sc.chrg.cpMax);
sc.seltyp = SEL_EMPTY;

View File

@ -2941,8 +2941,8 @@ static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM
if (cursor.pRun->member.run.style->fmt.dwMask & CFM_LINK &&
cursor.pRun->member.run.style->fmt.dwEffects & CFE_LINK)
{ /* The clicked run has CFE_LINK set */
info.nmhdr.hwndFrom = editor->hWnd;
info.nmhdr.idFrom = GetWindowLongW(editor->hWnd, GWLP_ID);
info.nmhdr.hwndFrom = NULL;
info.nmhdr.idFrom = 0;
info.nmhdr.code = EN_LINK;
info.msg = msg;
info.wParam = wParam;
@ -2950,7 +2950,7 @@ static void ME_LinkNotify(ME_TextEditor *editor, UINT msg, WPARAM wParam, LPARAM
cursor.nOffset = 0;
info.chrg.cpMin = ME_GetCursorOfs(&cursor);
info.chrg.cpMax = info.chrg.cpMin + cursor.pRun->member.run.strText->nLen;
SendMessageW(GetParent(editor->hWnd), WM_NOTIFY,info.nmhdr.idFrom, (LPARAM)&info);
ITextHost_TxNotify(editor->texthost, info.nmhdr.code, &info);
}
}

View File

@ -776,6 +776,8 @@ ME_SendRequestResize(ME_TextEditor *editor, BOOL force)
{
REQRESIZE info;
info.nmhdr.hwndFrom = NULL;
info.nmhdr.idFrom = 0;
info.nmhdr.code = EN_REQUESTRESIZE;
info.rc = rc;
info.rc.right = editor->nTotalWidth;