[PATCH 4/4] riched20: Send EN_UPDATE from TxDraw().

Huw Davies huw at codeweavers.com
Tue Mar 30 06:36:50 CDT 2021


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/riched20/paint.c        |  3 ---
 dlls/riched20/tests/txtsrv.c | 12 ++++++++++++
 dlls/riched20/txtsrv.c       |  4 ++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c
index f991b2bebcf..6ab7e4de76b 100644
--- a/dlls/riched20/paint.c
+++ b/dlls/riched20/paint.c
@@ -140,9 +140,6 @@ void ME_UpdateRepaint(ME_TextEditor *editor, BOOL update_now)
 
   update_caret( editor );
 
-  if (!editor->bEmulateVersion10 || (editor->nEventMask & ENM_UPDATE))
-    ITextHost_TxNotify( editor->texthost, EN_UPDATE, NULL );
-
   ITextHost_TxViewChange(editor->texthost, update_now);
 
   ME_SendSelChange(editor);
diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c
index 45e48a734fa..6834e38b7f5 100644
--- a/dlls/riched20/tests/txtsrv.c
+++ b/dlls/riched20/tests/txtsrv.c
@@ -399,6 +399,7 @@ static HRESULT __thiscall ITextHostImpl_TxGetPropertyBits(ITextHost *iface, DWOR
 }
 
 static int en_vscroll_sent;
+static int en_update_sent;
 static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code, void *data )
 {
     ITextHostTestImpl *This = impl_from_ITextHost(iface);
@@ -409,6 +410,10 @@ static HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost *iface, DWORD code,
         en_vscroll_sent++;
         ok( !data, "got %p\n", data );
         break;
+    case EN_UPDATE:
+        en_update_sent++;
+        ok( !data, "got %p\n", data );
+        break;
     }
     return S_OK;
 }
@@ -1152,6 +1157,13 @@ static void test_notifications( void )
     ok( hr == S_OK, "got %08x\n", hr );
     ok( en_vscroll_sent == 2, "got %d\n", en_vscroll_sent );
 
+    /* EN_UPDATE is sent by TxDraw() */
+    en_update_sent = 0;
+    hr = ITextServices_TxDraw( txtserv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, NULL,
+                               NULL, NULL, 0, TXTVIEW_ACTIVE );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( en_update_sent == 1, "got %d\n", en_update_sent );
+
     DestroyWindow( host_impl->window );
     ITextServices_Release( txtserv );
     ITextHost_Release( host );
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index 7a979971a0a..80e4682880f 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -193,6 +193,10 @@ DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD
         editor_mark_rewrap_all( services->editor );
         wrap_marked_paras_dc( services->editor, dc, FALSE );
     }
+
+    if (!services->editor->bEmulateVersion10 || services->editor->nEventMask & ENM_UPDATE)
+        ITextHost_TxNotify( services->editor->texthost, EN_UPDATE, NULL );
+
     editor_draw( services->editor, dc, update );
 
     if (!draw) ITextHost_TxReleaseDC( services->editor->texthost, dc );
-- 
2.23.0




More information about the wine-devel mailing list