Module: wine Branch: master Commit: 62f96b039794685a97fcf8055312e0afdb0b2add URL: https://source.winehq.org/git/wine.git/?a=commit;h=62f96b039794685a97fcf8055...
Author: Huw Davies huw@codeweavers.com Date: Tue Mar 30 12:36:50 2021 +0100
riched20: Send EN_UPDATE from TxDraw().
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
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 );