Huw Davies : riched20: Clearing the insert style should not depend on the event mask.
Alexandre Julliard
julliard at winehq.org
Tue Oct 4 13:38:26 CDT 2016
Module: wine
Branch: master
Commit: df1b51dfa48d14f4e3dfe776c73050e3ad42608e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=df1b51dfa48d14f4e3dfe776c73050e3ad42608e
Author: Huw Davies <huw at codeweavers.com>
Date: Tue Oct 4 13:07:36 2016 +0100
riched20: Clearing the insert style should not depend on the event mask.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/riched20/caret.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/riched20/caret.c b/dlls/riched20/caret.c
index 1dacdfa..a47930f 100644
--- a/dlls/riched20/caret.c
+++ b/dlls/riched20/caret.c
@@ -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);
+ }
}
}
More information about the wine-cvs
mailing list