Add an interface to nsDataObjectCollection so we can QI to check to make sure

it is one of our objects before doing the static cast.
Bug 106211 r=pink sr=jst


git-svn-id: svn://10.0.0.236/trunk@123311 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rods%netscape.com
2002-06-14 11:28:13 +00:00
parent 9b174da0a3
commit 99a9d007bd
4 changed files with 43 additions and 6 deletions

View File

@@ -60,7 +60,6 @@ ULONG nsDataObjCollection::g_cRef = 0;
EXTERN_C GUID CDECL CLSID_nsDataObjCollection =
{ 0x2d851b91, 0xd4c, 0x11d3, { 0x96, 0xd4, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } };
/*
* Class nsDataObjCollection
*/
@@ -113,7 +112,13 @@ STDMETHODIMP nsDataObjCollection::QueryInterface(REFIID riid, void** ppv)
*ppv=NULL;
if ( (IID_IUnknown == riid) || (IID_IDataObject == riid) ) {
*ppv = this;
*ppv = static_cast<IDataObject*>(this);
AddRef();
return NOERROR;
}
if ( IID_IDataObjCollection == riid ) {
*ppv = static_cast<nsIDataObjCollection*>(this);
AddRef();
return NOERROR;
}