Commit cc3a86d8 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Remove the windows from the editor structure.

This in turn allows removal of the editor from the host. Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent f83a5278
...@@ -2933,8 +2933,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) ...@@ -2933,8 +2933,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
LONG selbarwidth; LONG selbarwidth;
HRESULT hr; HRESULT hr;
ed->hWnd = NULL;
ed->hwndParent = NULL;
ed->sizeWindow.cx = ed->sizeWindow.cy = 0; ed->sizeWindow.cx = ed->sizeWindow.cy = 0;
if (ITextHost_QueryInterface( texthost, &IID_ITextHost2, (void **)&ed->texthost ) == S_OK) if (ITextHost_QueryInterface( texthost, &IID_ITextHost2, (void **)&ed->texthost ) == S_OK)
{ {
......
...@@ -395,7 +395,7 @@ BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN; ...@@ -395,7 +395,7 @@ BOOL ME_Redo(ME_TextEditor *editor) DECLSPEC_HIDDEN;
void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN; void ME_EmptyUndoStack(ME_TextEditor *editor) DECLSPEC_HIDDEN;
/* txtsrv.c */ /* 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 #ifdef __ASM_USE_THISCALL_WRAPPER
extern const struct ITextServicesVtbl text_services_stdcall_vtbl DECLSPEC_HIDDEN; extern const struct ITextServicesVtbl text_services_stdcall_vtbl DECLSPEC_HIDDEN;
#define TXTSERV_VTABLE(This) (&text_services_stdcall_vtbl) #define TXTSERV_VTABLE(This) (&text_services_stdcall_vtbl)
......
...@@ -377,7 +377,6 @@ typedef struct tagME_InStream ME_InStream; ...@@ -377,7 +377,6 @@ typedef struct tagME_InStream ME_InStream;
typedef struct tagME_TextEditor typedef struct tagME_TextEditor
{ {
HWND hWnd, hwndParent;
ITextHost2 *texthost; ITextHost2 *texthost;
IUnknown *reOle; IUnknown *reOle;
unsigned int bEmulateVersion10 : 1; unsigned int bEmulateVersion10 : 1;
......
...@@ -36,7 +36,6 @@ struct host ...@@ -36,7 +36,6 @@ struct host
ITextHost2 ITextHost_iface; ITextHost2 ITextHost_iface;
LONG ref; LONG ref;
ITextServices *text_srv; ITextServices *text_srv;
ME_TextEditor *editor; /* to be removed */
HWND window, parent; HWND window, parent;
unsigned int emulate_10 : 1; unsigned int emulate_10 : 1;
unsigned int dialog_mode : 1; unsigned int dialog_mode : 1;
...@@ -112,7 +111,6 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 ) ...@@ -112,7 +111,6 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 )
texthost->para_fmt.wAlignment = PFA_RIGHT; texthost->para_fmt.wAlignment = PFA_RIGHT;
if (cs->style & ES_CENTER) if (cs->style & ES_CENTER)
texthost->para_fmt.wAlignment = PFA_CENTER; texthost->para_fmt.wAlignment = PFA_CENTER;
texthost->editor = NULL;
host_init_props( texthost ); host_init_props( texthost );
texthost->event_mask = 0; texthost->event_mask = 0;
texthost->use_set_rect = 0; texthost->use_set_rect = 0;
...@@ -871,7 +869,7 @@ static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emula ...@@ -871,7 +869,7 @@ static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emula
if (!host) return FALSE; 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 )) if (FAILED( hr ))
{ {
ITextHost2_Release( &host->ITextHost_iface ); ITextHost2_Release( &host->ITextHost_iface );
...@@ -880,9 +878,6 @@ static BOOL create_windowed_editor( HWND hwnd, CREATESTRUCTW *create, BOOL emula ...@@ -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_QueryInterface( unk, &IID_ITextServices, (void **)&host->text_srv );
IUnknown_Release( unk ); 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 ); SetWindowLongPtrW( hwnd, 0, (LONG_PTR)host );
return TRUE; return TRUE;
......
...@@ -581,8 +581,7 @@ static const ITextServicesVtbl textservices_vtbl = ...@@ -581,8 +581,7 @@ static const ITextServicesVtbl textservices_vtbl =
THISCALL(fnTextSrv_TxGetCachedSize) THISCALL(fnTextSrv_TxGetCachedSize)
}; };
HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10, HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10 )
ME_TextEditor **editor )
{ {
struct text_services *services; struct text_services *services;
...@@ -595,7 +594,6 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown ** ...@@ -595,7 +594,6 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **
services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl; services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
services->ITextServices_iface.lpVtbl = &textservices_vtbl; services->ITextServices_iface.lpVtbl = &textservices_vtbl;
services->editor = ME_MakeEditor( text_host, emulate_10 ); services->editor = ME_MakeEditor( text_host, emulate_10 );
if (editor) *editor = services->editor; /* To be removed */
if (outer) services->outer_unk = outer; if (outer) services->outer_unk = outer;
else services->outer_unk = &services->IUnknown_inner; else services->outer_unk = &services->IUnknown_inner;
...@@ -609,5 +607,5 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown ** ...@@ -609,5 +607,5 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **
*/ */
HRESULT WINAPI CreateTextServices( IUnknown *outer, ITextHost *text_host, IUnknown **unk ) 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 );
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment