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.
This commit is contained in:
parent
bc4633a25b
commit
0342ab0df1
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue