mshtml: COM cleanup for the IOleControl iface.

This commit is contained in:
Michael Stefaniuc 2010-12-27 01:46:09 +01:00 committed by Alexandre Julliard
parent 541a49edc2
commit 6c7a78eca0
3 changed files with 19 additions and 18 deletions

View File

@ -1779,7 +1779,7 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
*ppv = &This->IOleCommandTarget_iface;
}else if(IsEqualGUID(&IID_IOleControl, riid)) {
TRACE("(%p)->(IID_IOleControl, %p)\n", This, ppv);
*ppv = CONTROL(This);
*ppv = &This->IOleControl_iface;
}else if(IsEqualGUID(&IID_IHlinkTarget, riid)) {
TRACE("(%p)->(IID_IHlinkTarget, %p)\n", This, ppv);
*ppv = HLNKTARGET(This);

View File

@ -359,7 +359,7 @@ struct HTMLDocument {
IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface;
IServiceProvider IServiceProvider_iface;
IOleCommandTarget IOleCommandTarget_iface;
const IOleControlVtbl *lpOleControlVtbl;
IOleControl IOleControl_iface;
const IHlinkTargetVtbl *lpHlinkTargetVtbl;
IPersistStreamInit IPersistStreamInit_iface;
const IDispatchExVtbl *lpIDispatchExVtbl;
@ -625,7 +625,6 @@ struct HTMLDocumentNode {
#define HTMLWINDOW2(x) ((IHTMLWindow2*) &(x)->lpHTMLWindow2Vtbl)
#define HTMLWINDOW3(x) ((IHTMLWindow3*) &(x)->lpHTMLWindow3Vtbl)
#define HTMLWINDOW4(x) ((IHTMLWindow4*) &(x)->lpHTMLWindow4Vtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define HLNKTARGET(x) ((IHlinkTarget*) &(x)->lpHlinkTargetVtbl)
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define CUSTOMDOC(x) ((ICustomDoc*) &(x)->lpCustomDocVtbl)

View File

@ -216,9 +216,10 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
}
if(This->doc_obj->usermode == UNKNOWN_USERMODE)
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
IOleControl_OnAmbientPropertyChange(&This->IOleControl_iface, DISPID_AMBIENT_USERMODE);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
IOleControl_OnAmbientPropertyChange(&This->IOleControl_iface,
DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
if(SUCCEEDED(hres)) {
@ -228,8 +229,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
FIXME("silent == true\n");
}
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERAGENT);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_PALETTE);
IOleControl_OnAmbientPropertyChange(&This->IOleControl_iface, DISPID_AMBIENT_USERAGENT);
IOleControl_OnAmbientPropertyChange(&This->IOleControl_iface, DISPID_AMBIENT_PALETTE);
return S_OK;
}
@ -573,36 +574,39 @@ static const IOleDocumentVtbl OleDocumentVtbl = {
* IOleControl implementation
*/
#define CONTROL_THIS(iface) DEFINE_THIS(HTMLDocument, OleControl, iface)
static inline HTMLDocument *impl_from_IOleControl(IOleControl *iface)
{
return CONTAINING_RECORD(iface, HTMLDocument, IOleControl_iface);
}
static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
return htmldoc_query_interface(This, riid, ppv);
}
static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
return htmldoc_addref(This);
}
static ULONG WINAPI OleControl_Release(IOleControl *iface)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
return htmldoc_release(This);
}
static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
FIXME("(%p)->(%p)\n", This, pCI);
return E_NOTIMPL;
}
static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *pMsg)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
FIXME("(%p)->(%p)\n", This, pMsg);
return E_NOTIMPL;
}
@ -644,7 +648,7 @@ static HRESULT on_change_dlcontrol(HTMLDocument *This)
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
IOleClientSite *client;
VARIANT res;
HRESULT hres;
@ -734,13 +738,11 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
{
HTMLDocument *This = CONTROL_THIS(iface);
HTMLDocument *This = impl_from_IOleControl(iface);
FIXME("(%p)->(%x)\n", This, bFreeze);
return E_NOTIMPL;
}
#undef CONTROL_THIS
static const IOleControlVtbl OleControlVtbl = {
OleControl_QueryInterface,
OleControl_AddRef,
@ -873,7 +875,7 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
{
This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
This->IOleDocument_iface.lpVtbl = &OleDocumentVtbl;
This->lpOleControlVtbl = &OleControlVtbl;
This->IOleControl_iface.lpVtbl = &OleControlVtbl;
This->lpObjectWithSiteVtbl = &ObjectWithSiteVtbl;
This->IOleContainer_iface.lpVtbl = &OleContainerVtbl;
}