Module: wine Branch: master Commit: cc3a86d86b527d354b52e5645769cd94560577fe URL: https://source.winehq.org/git/wine.git/?a=commit;h=cc3a86d86b527d354b52e5645...
Author: Huw Davies huw@codeweavers.com Date: Fri Mar 26 09:08:05 2021 +0000
riched20: Remove the windows from the editor structure.
This in turn allows removal of the editor from the host.
Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/riched20/editor.c | 2 -- dlls/riched20/editor.h | 2 +- dlls/riched20/editstr.h | 1 - dlls/riched20/txthost.c | 7 +------ dlls/riched20/txtsrv.c | 6 ++---- 5 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 4ac78f3d3cb..28b5cb1512d 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2933,8 +2933,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) LONG selbarwidth; HRESULT hr;
- ed->hWnd = NULL; - ed->hwndParent = NULL; ed->sizeWindow.cx = ed->sizeWindow.cy = 0; if (ITextHost_QueryInterface( texthost, &IID_ITextHost2, (void **)&ed->texthost ) == S_OK) { diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index e923f35ed94..7a79df83c99 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -395,7 +395,7 @@ BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN;
/* txtsrv.c */ -HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10, ME_TextEditor **editor ) DECLSPEC_HIDDEN; +HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10 ) DECLSPEC_HIDDEN; #ifdef __ASM_USE_THISCALL_WRAPPER extern const struct ITextServicesVtbl text_services_stdcall_vtbl DECLSPEC_HIDDEN; #define TXTSERV_VTABLE(This) (&text_services_stdcall_vtbl) diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index ffafa794015..86b3f0196c7 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -377,7 +377,6 @@ typedef struct tagME_InStream ME_InStream;
typedef struct tagME_TextEditor { - HWND hWnd, hwndParent; ITextHost2 *texthost; IUnknown *reOle; unsigned int bEmulateVersion10 : 1; diff --git a/dlls/riched20/txthost.c b/dlls/riched20/txthost.c index c220fe5ec57..a7b91716dab 100644 --- a/dlls/riched20/txthost.c +++ b/dlls/riched20/txthost.c @@ -36,7 +36,6 @@ struct host ITextHost2 ITextHost_iface; LONG ref; ITextServices *text_srv; - ME_TextEditor *editor; /* to be removed */ HWND window, parent; unsigned int emulate_10 : 1; unsigned int dialog_mode : 1; @@ -112,7 +111,6 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) texthost->para_fmt.wAlignment = PFA_RIGHT; if (cs->style & ES_CENTER) texthost->para_fmt.wAlignment = PFA_CENTER; - texthost->editor = NULL; host_init_props( texthost ); texthost->event_mask = 0; texthost->use_set_rect = 0; @@ -871,7 +869,7 @@ static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emula
if (!host) return FALSE;
- hr = create_text_services( NULL, (ITextHost *)&host->ITextHost_iface, &unk, emulate_10, &host->editor ); + hr = create_text_services( NULL, (ITextHost *)&host->ITextHost_iface, &unk, emulate_10 ); if (FAILED( hr )) { ITextHost2_Release( &host->ITextHost_iface ); @@ -880,9 +878,6 @@ static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emula IUnknown_QueryInterface( unk, &IID_ITextServices, (void **)&host->text_srv ); IUnknown_Release( unk );
- host->editor->hWnd = hwnd; /* FIXME: Remove editor's dependence on hWnd */ - host->editor->hwndParent = create->hwndParent; - SetWindowLongPtrW( hwnd, 0, (LONG_PTR)host );
return TRUE; diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c index 4cd19a0d24b..7a979971a0a 100644 --- a/dlls/riched20/txtsrv.c +++ b/dlls/riched20/txtsrv.c @@ -581,8 +581,7 @@ static const ITextServicesVtbl textservices_vtbl = THISCALL(fnTextSrv_TxGetCachedSize) };
-HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10, - ME_TextEditor **editor ) +HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10 ) { struct text_services *services;
@@ -595,7 +594,6 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown ** services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; services->ITextServices_iface.lpVtbl = &textservices_vtbl; services->editor = ME_MakeEditor( text_host, emulate_10 ); - if (editor) *editor = services->editor; /* To be removed */
if (outer) services->outer_unk = outer; else services->outer_unk = &services->IUnknown_inner; @@ -609,5 +607,5 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown ** */ HRESULT WINAPI CreateTextServices( IUnknown *outer, ITextHost *text_host, IUnknown **unk ) { - return create_text_services( outer, text_host, unk, FALSE, NULL ); + return create_text_services( outer, text_host, unk, FALSE ); }