Commit 92e3036c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Implement IOleDocumentView and IViewObjectEx interfaces in…

mshtml: Implement IOleDocumentView and IViewObjectEx interfaces in HTMLDocumentObj object instead of HTMLDocument. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent e55e6b8c
......@@ -4761,16 +4761,8 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*ppv = &This->IOleObject_iface;
else if(IsEqualGUID(&IID_IOleDocument, riid))
*ppv = &This->IOleDocument_iface;
else if(IsEqualGUID(&IID_IOleDocumentView, riid))
*ppv = &This->IOleDocumentView_iface;
else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid))
*ppv = &This->IOleInPlaceActiveObject_iface;
else if(IsEqualGUID(&IID_IViewObject, riid))
*ppv = &This->IViewObjectEx_iface;
else if(IsEqualGUID(&IID_IViewObject2, riid))
*ppv = &This->IViewObjectEx_iface;
else if(IsEqualGUID(&IID_IViewObjectEx, riid))
*ppv = &This->IViewObjectEx_iface;
else if(IsEqualGUID(&IID_IOleWindow, riid))
*ppv = &This->IOleInPlaceActiveObject_iface;
else if(IsEqualGUID(&IID_IOleInPlaceObject, riid))
......@@ -4861,7 +4853,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex)
HTMLDocument_Persist_Init(doc);
HTMLDocument_OleCmd_Init(doc);
HTMLDocument_OleObj_Init(doc);
HTMLDocument_View_Init(doc);
HTMLDocument_Service_Init(doc);
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocument_cpc);
......@@ -5247,6 +5238,14 @@ static HRESULT WINAPI HTMLDocumentObj_QueryInterface(IUnknown *iface, REFIID rii
return *ppv ? S_OK : E_NOINTERFACE;
}else if(IsEqualGUID(&IID_ICustomDoc, riid)) {
*ppv = &This->ICustomDoc_iface;
}else if(IsEqualGUID(&IID_IOleDocumentView, riid)) {
*ppv = &This->IOleDocumentView_iface;
}else if(IsEqualGUID(&IID_IViewObject, riid)) {
*ppv = &This->IViewObjectEx_iface;
}else if(IsEqualGUID(&IID_IViewObject2, riid)) {
*ppv = &This->IViewObjectEx_iface;
}else if(IsEqualGUID(&IID_IViewObjectEx, riid)) {
*ppv = &This->IViewObjectEx_iface;
}else if(IsEqualGUID(&IID_ITargetContainer, riid)) {
*ppv = &This->ITargetContainer_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
......@@ -5304,7 +5303,7 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface)
if(This->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.IOleInPlaceObjectWindowless_iface);
if(This->ipsite)
IOleDocumentView_SetInPlaceSite(&This->basedoc.IOleDocumentView_iface, NULL);
IOleDocumentView_SetInPlaceSite(&This->IOleDocumentView_iface, NULL);
if(This->undomgr)
IOleUndoManager_Release(This->undomgr);
if(This->editsvcs)
......@@ -5450,7 +5449,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc->usermode = UNKNOWN_USERMODE;
doc->task_magic = get_task_target_magic();
init_binding_ui(doc);
HTMLDocument_View_Init(doc);
hres = create_nscontainer(doc, &doc->nscontainer);
if(FAILED(hres)) {
......
......@@ -595,9 +595,7 @@ struct HTMLDocument {
IMonikerProp IMonikerProp_iface;
IOleObject IOleObject_iface;
IOleDocument IOleDocument_iface;
IOleDocumentView IOleDocumentView_iface;
IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
IViewObjectEx IViewObjectEx_iface;
IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
IServiceProvider IServiceProvider_iface;
IOleCommandTarget IOleCommandTarget_iface;
......@@ -642,6 +640,8 @@ struct HTMLDocumentObj {
DispatchEx dispex;
IUnknown IUnknown_outer;
ICustomDoc ICustomDoc_iface;
IOleDocumentView IOleDocumentView_iface;
IViewObjectEx IViewObjectEx_iface;
ITargetContainer ITargetContainer_iface;
IWindowForBindingUI IWindowForBindingUI_iface;
......@@ -876,11 +876,10 @@ HRESULT create_storage(IHTMLStorage**) DECLSPEC_HIDDEN;
void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_View_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_Service_Init(HTMLDocument*) DECLSPEC_HIDDEN;
void HTMLDocument_View_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
void TargetContainer_Init(HTMLDocumentObj*) DECLSPEC_HIDDEN;
void init_binding_ui(HTMLDocumentObj*) DECLSPEC_HIDDEN;
void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode*) DECLSPEC_HIDDEN;
......
......@@ -547,17 +547,17 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpms
HTMLDocument_LockContainer(This->doc_obj, TRUE);
/* FIXME: Create new IOleDocumentView. See CreateView for more info. */
hres = IOleDocumentSite_ActivateMe(pDocSite, &This->IOleDocumentView_iface);
hres = IOleDocumentSite_ActivateMe(pDocSite, &This->doc_obj->IOleDocumentView_iface);
IOleDocumentSite_Release(pDocSite);
}else {
hres = IOleDocumentView_UIActivate(&This->IOleDocumentView_iface, TRUE);
hres = IOleDocumentView_UIActivate(&This->doc_obj->IOleDocumentView_iface, TRUE);
if(SUCCEEDED(hres)) {
if(lprcPosRect) {
RECT rect; /* We need to pass rect as not const pointer */
rect = *lprcPosRect;
IOleDocumentView_SetRect(&This->IOleDocumentView_iface, &rect);
IOleDocumentView_SetRect(&This->doc_obj->IOleDocumentView_iface, &rect);
}
IOleDocumentView_Show(&This->IOleDocumentView_iface, TRUE);
IOleDocumentView_Show(&This->doc_obj->IOleDocumentView_iface, TRUE);
}
}
......@@ -751,7 +751,7 @@ static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSit
*/
if(pIPSite) {
hres = IOleDocumentView_SetInPlaceSite(&This->IOleDocumentView_iface, pIPSite);
hres = IOleDocumentView_SetInPlaceSite(&This->doc_obj->IOleDocumentView_iface, pIPSite);
if(FAILED(hres))
return hres;
}
......@@ -759,8 +759,8 @@ static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSit
if(pstm)
FIXME("pstm is not supported\n");
IOleDocumentView_AddRef(&This->IOleDocumentView_iface);
*ppView = &This->IOleDocumentView_iface;
IOleDocumentView_AddRef(&This->doc_obj->IOleDocumentView_iface);
*ppView = &This->doc_obj->IOleDocumentView_iface;
return S_OK;
}
......@@ -1127,7 +1127,7 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
TRACE("(%p)\n", This);
if(This->doc_obj->ui_active)
IOleDocumentView_UIActivate(&This->IOleDocumentView_iface, FALSE);
IOleDocumentView_UIActivate(&This->doc_obj->IOleDocumentView_iface, FALSE);
This->doc_obj->window_active = FALSE;
if(!This->doc_obj->in_place_active)
......
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