riched20: Send EN_UPDATE from TxDraw().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2021-03-30 12:36:50 +01:00 committed by Alexandre Julliard
parent de1398ef38
commit 62f96b0397
3 changed files with 16 additions and 3 deletions

View file

@ -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);

View file

@ -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 );

View file

@ -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 );