Bug 539699-ITypeInfo nsAccessible member conversion to static r=tbsaunde

This commit is contained in:
Andrew Quartey 2012-01-05 22:45:27 -05:00
parent aec89d9220
commit 2a9e9bcedd
2 changed files with 9 additions and 9 deletions

View File

@ -91,12 +91,14 @@ static const PRInt32 kIEnumVariantDisconnected = -1;
// nsAccessibleWrap
////////////////////////////////////////////////////////////////////////////////
ITypeInfo* nsAccessibleWrap::gTypeInfo = NULL;
//-----------------------------------------------------
// construction
//-----------------------------------------------------
nsAccessibleWrap::
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
nsAccessible(aContent, aShell), mEnumVARIANTPosition(0), mTypeInfo(NULL)
nsAccessible(aContent, aShell), mEnumVARIANTPosition(0)
{
}
@ -105,8 +107,6 @@ nsAccessibleWrap::
//-----------------------------------------------------
nsAccessibleWrap::~nsAccessibleWrap()
{
if (mTypeInfo)
mTypeInfo->Release();
}
NS_IMPL_ISUPPORTS_INHERITED0(nsAccessibleWrap, nsAccessible);
@ -1835,19 +1835,19 @@ void nsAccessibleWrap::UpdateSystemCaret()
ITypeInfo*
nsAccessibleWrap::GetTI(LCID lcid)
{
if (mTypeInfo)
return mTypeInfo;
if (gTypeInfo)
return gTypeInfo;
ITypeLib *typeLib = NULL;
HRESULT hr = LoadRegTypeLib(LIBID_Accessibility, 1, 0, lcid, &typeLib);
if (FAILED(hr))
return NULL;
hr = typeLib->GetTypeInfoOfGuid(IID_IAccessible, &mTypeInfo);
hr = typeLib->GetTypeInfoOfGuid(IID_IAccessible, &gTypeInfo);
typeLib->Release();
if (FAILED(hr))
return NULL;
return mTypeInfo;
return gTypeInfo;
}

View File

@ -356,9 +356,9 @@ protected:
/**
* Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it.
*/
ITypeInfo *GetTI(LCID lcid);
static ITypeInfo* GetTI(LCID lcid);
ITypeInfo *mTypeInfo;
static ITypeInfo* gTypeInfo;
enum navRelations {