Commit 62e9961e authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: COM cleanup for the IOleInPlaceObjectWindowless iface.

parent 17635821
......@@ -1767,10 +1767,10 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*ppv = &This->IOleInPlaceActiveObject_iface;
}else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) {
TRACE("(%p)->(IID_IOleInPlaceObject, %p)\n", This, ppv);
*ppv = INPLACEOBJ(This);
*ppv = &This->IOleInPlaceObjectWindowless_iface;
}else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) {
TRACE("(%p)->(IID_IOleInPlaceObjectWindowless, %p)\n", This, ppv);
*ppv = INPLACEWIN(This);
*ppv = &This->IOleInPlaceObjectWindowless_iface;
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
TRACE("(%p)->(IID_IServiceProvider, %p)\n", This, ppv);
*ppv = SERVPROV(This);
......@@ -2106,7 +2106,7 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
if(This->hostui)
ICustomDoc_SetUIHandler(CUSTOMDOC(This), NULL);
if(This->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(&This->basedoc));
IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->basedoc.IOleInPlaceObjectWindowless_iface);
if(This->ipsite)
IOleDocumentView_SetInPlaceSite(&This->basedoc.IOleDocumentView_iface, NULL);
if(This->undomgr)
......
......@@ -356,7 +356,7 @@ struct HTMLDocument {
IOleDocumentView IOleDocumentView_iface;
IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
IViewObjectEx IViewObjectEx_iface;
const IOleInPlaceObjectWindowlessVtbl *lpOleInPlaceObjectWindowlessVtbl;
IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
const IServiceProviderVtbl *lpServiceProviderVtbl;
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
const IOleControlVtbl *lpOleControlVtbl;
......@@ -625,8 +625,6 @@ struct HTMLDocumentNode {
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
#define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
#define INPLACEWIN(x) ((IOleInPlaceObjectWindowless*) &(x)->lpOleInPlaceObjectWindowlessVtbl)
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
#define CMDTARGET(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
......
......@@ -267,7 +267,7 @@ static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
FIXME("OLECLOSE_PROMPTSAVE not implemented\n");
if(This->doc_obj->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface);
HTMLDocument_LockContainer(This->doc_obj, FALSE);
......
......@@ -146,44 +146,47 @@ static const IOleInPlaceActiveObjectVtbl OleInPlaceActiveObjectVtbl = {
* IOleInPlaceObjectWindowless implementation
*/
#define OLEINPLACEWND_THIS(iface) DEFINE_THIS(HTMLDocument, OleInPlaceObjectWindowless, iface)
static inline HTMLDocument *impl_from_IOleInPlaceObjectWindowless(IOleInPlaceObjectWindowless *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IOleInPlaceObjectWindowless_iface);
}
static HRESULT WINAPI OleInPlaceObjectWindowless_QueryInterface(IOleInPlaceObjectWindowless *iface,
REFIID riid, void **ppv)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
return htmldoc_query_interface(This, riid, ppv);
}
static ULONG WINAPI OleInPlaceObjectWindowless_AddRef(IOleInPlaceObjectWindowless *iface)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
return htmldoc_addref(This);
}
static ULONG WINAPI OleInPlaceObjectWindowless_Release(IOleInPlaceObjectWindowless *iface)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
return htmldoc_release(This);
}
static HRESULT WINAPI OleInPlaceObjectWindowless_GetWindow(IOleInPlaceObjectWindowless *iface,
HWND *phwnd)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
return IOleWindow_GetWindow(&This->IOleInPlaceActiveObject_iface, phwnd);
}
static HRESULT WINAPI OleInPlaceObjectWindowless_ContextSensitiveHelp(IOleInPlaceObjectWindowless *iface,
BOOL fEnterMode)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
return IOleWindow_ContextSensitiveHelp(&This->IOleInPlaceActiveObject_iface, fEnterMode);
}
static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceObjectWindowless *iface)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
TRACE("(%p)\n", This);
......@@ -224,7 +227,7 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectWindowless *iface)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
......@@ -232,14 +235,14 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_UIDeactivate(IOleInPlaceObjectW
static HRESULT WINAPI OleInPlaceObjectWindowless_SetObjectRects(IOleInPlaceObjectWindowless *iface,
LPCRECT lprcPosRect, LPCRECT lprcClipRect)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
FIXME("(%p)->(%p %p)\n", This, lprcPosRect, lprcClipRect);
return E_NOTIMPL;
}
static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceObjectWindowless *iface)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
......@@ -247,7 +250,7 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_ReactivateAndUndo(IOleInPlaceOb
static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObjectWindowless *iface,
UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *lpResult)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
FIXME("(%p)->(%u %lu %lu %p)\n", This, msg, wParam, lParam, lpResult);
return E_NOTIMPL;
}
......@@ -255,7 +258,7 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_OnWindowMessage(IOleInPlaceObje
static HRESULT WINAPI OleInPlaceObjectWindowless_GetDropTarget(IOleInPlaceObjectWindowless *iface,
IDropTarget **ppDropTarget)
{
HTMLDocument *This = OLEINPLACEWND_THIS(iface);
HTMLDocument *This = impl_from_IOleInPlaceObjectWindowless(iface);
FIXME("(%p)->(%p)\n", This, ppDropTarget);
return E_NOTIMPL;
}
......@@ -274,10 +277,8 @@ static const IOleInPlaceObjectWindowlessVtbl OleInPlaceObjectWindowlessVtbl = {
OleInPlaceObjectWindowless_GetDropTarget
};
#undef INPLACEWIN_THIS
void HTMLDocument_Window_Init(HTMLDocument *This)
{
This->IOleInPlaceActiveObject_iface.lpVtbl = &OleInPlaceActiveObjectVtbl;
This->lpOleInPlaceObjectWindowlessVtbl = &OleInPlaceObjectWindowlessVtbl;
This->IOleInPlaceObjectWindowless_iface.lpVtbl = &OleInPlaceObjectWindowlessVtbl;
}
......@@ -574,7 +574,7 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
ShowWindow(This->doc_obj->hwnd, SW_HIDE);
if(This->doc_obj->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
IOleInPlaceObjectWindowless_InPlaceDeactivate(&This->IOleInPlaceObjectWindowless_iface);
if(This->doc_obj->ip_window) {
IOleInPlaceUIWindow_Release(This->doc_obj->ip_window);
......
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