riched20: Clearing the insert style should not depend on the event mask.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-10-04 13:07:36 +01:00 committed by Alexandre Julliard
parent 304c8320c9
commit df1b51dfa4
1 changed files with 10 additions and 8 deletions

View File

@ -1515,9 +1515,6 @@ void ME_SendSelChange(ME_TextEditor *editor)
{
SELCHANGE sc;
if (!(editor->nEventMask & ENM_SELCHANGE))
return;
sc.nmhdr.hwndFrom = NULL;
sc.nmhdr.idFrom = 0;
sc.nmhdr.code = EN_SELCHANGE;
@ -1527,16 +1524,21 @@ void ME_SendSelChange(ME_TextEditor *editor)
sc.seltyp |= SEL_TEXT;
if (sc.chrg.cpMin < sc.chrg.cpMax+1) /* what were RICHEDIT authors thinking ? */
sc.seltyp |= SEL_MULTICHAR;
TRACE("cpMin=%d cpMax=%d seltyp=%d (%s %s)\n",
sc.chrg.cpMin, sc.chrg.cpMax, sc.seltyp,
(sc.seltyp & SEL_TEXT) ? "SEL_TEXT" : "",
(sc.seltyp & SEL_MULTICHAR) ? "SEL_MULTICHAR" : "");
if (sc.chrg.cpMin != editor->notified_cr.cpMin || sc.chrg.cpMax != editor->notified_cr.cpMax)
{
ME_ClearTempStyle(editor);
editor->notified_cr = sc.chrg;
ITextHost_TxNotify(editor->texthost, sc.nmhdr.code, &sc);
if (editor->nEventMask & ENM_SELCHANGE)
{
TRACE("cpMin=%d cpMax=%d seltyp=%d (%s %s)\n",
sc.chrg.cpMin, sc.chrg.cpMax, sc.seltyp,
(sc.seltyp & SEL_TEXT) ? "SEL_TEXT" : "",
(sc.seltyp & SEL_MULTICHAR) ? "SEL_MULTICHAR" : "");
ITextHost_TxNotify(editor->texthost, sc.nmhdr.code, &sc);
}
}
}