Commit c350e000 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ole32: Add a check for NULL This->dataAdviseHolder in DefaultHandler_Stop.

Cleanup DefaultHandler_GetCanonicalFormatEtc by using This->pDataDelegate instead of querying for IDataObject from This->pOleDelegate.
parent 8d7bfca9
...@@ -416,7 +416,8 @@ static void WINAPI DefaultHandler_Stop(DefaultHandler *This) ...@@ -416,7 +416,8 @@ static void WINAPI DefaultHandler_Stop(DefaultHandler *This)
/* FIXME: call IOleCache_OnStop */ /* FIXME: call IOleCache_OnStop */
DataAdviseHolder_OnDisconnect(This->dataAdviseHolder); if (This->dataAdviseHolder)
DataAdviseHolder_OnDisconnect(This->dataAdviseHolder);
if (This->pDataDelegate) if (This->pDataDelegate)
{ {
IDataObject_Release(This->pDataDelegate); IDataObject_Release(This->pDataDelegate);
...@@ -1030,16 +1031,13 @@ static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( ...@@ -1030,16 +1031,13 @@ static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
LPFORMATETC pformatetcOut) LPFORMATETC pformatetcOut)
{ {
DefaultHandler *This = impl_from_IDataObject(iface); DefaultHandler *This = impl_from_IDataObject(iface);
IDataObject *pDataObject;
HRESULT hr;
TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut); TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut);
if (!This->pOleDelegate) if (!This->pDataDelegate)
return OLE_E_NOTRUNNING; return OLE_E_NOTRUNNING;
hr = IOleObject_QueryInterface(This->pOleDelegate, &IID_IDataObject, (void **)&pDataObject); return IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut);
return IDataObject_GetCanonicalFormatEtc(pDataObject, pformatetcIn, pformatetcOut);
} }
/************************************************************************ /************************************************************************
......
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