fix bug 9841
This commit is contained in:
Родитель
8edd850da4
Коммит
29d5937475
|
@ -69,13 +69,15 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
|
|||
nsresult res;
|
||||
|
||||
if (aFactory == NULL) return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aFactory = NULL;
|
||||
//
|
||||
// first check for the nsILocaleFactory interfaces
|
||||
//
|
||||
if (aClass.Equals(kLocaleFactoryCID))
|
||||
{
|
||||
nsLocaleFactory *factory = new nsLocaleFactory();
|
||||
if(nsnull == factory)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
res = factory->QueryInterface(kILocaleFactoryIID, (void **) aFactory);
|
||||
|
||||
if (NS_FAILED(res))
|
||||
|
@ -90,6 +92,8 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
|
|||
if (aClass.Equals(kMacLocaleFactoryCID))
|
||||
{
|
||||
nsMacLocaleFactory *mac_factory = new nsMacLocaleFactory();
|
||||
if(nsnull == mac_factory)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
res = mac_factory->QueryInterface(kIFactoryIID,(void**) aFactory);
|
||||
|
||||
if (NS_FAILED(res))
|
||||
|
|
|
@ -212,8 +212,13 @@ nsresult nsCollationFactoryOS2::CreateCollation( nsILocale *aLocale,
|
|||
if( !aLocale || !aInstance)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aInstance = nsnull;
|
||||
|
||||
nsCollationOS2 *coll = new nsCollationOS2;
|
||||
|
||||
if(nsnull == coll)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rc = coll->Initialize( aLocale);
|
||||
|
||||
if( NS_SUCCEEDED(rc))
|
||||
|
|
|
@ -44,7 +44,10 @@ nsresult nsLocaleFactoryOS2::NewLocale( nsString **aCatList,
|
|||
if( !aCatList || !aValList || !aLocale)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aLocale = nsnull;
|
||||
nsLocaleOS2 *aLoc = new nsLocaleOS2;
|
||||
if(nsnull == aLoc)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rc = aLoc->Init( aCatList, aValList, aCount);
|
||||
|
||||
|
@ -65,7 +68,10 @@ nsresult nsLocaleFactoryOS2::NewLocale( const nsString *aName,
|
|||
if( !aName || !aLocale)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
*aLocale = nsnull;
|
||||
nsLocaleOS2 *aLoc = new nsLocaleOS2;
|
||||
if(nsnull == aLoc)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rc = aLoc->Init( *aName);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче