Changed to use do_GetService instead of CreateInstance, bug 30203, r=cata.

This commit is contained in:
nhotta%netscape.com 2000-03-17 01:14:57 +00:00
Родитель ace449734a
Коммит 54bb0f719f
1 изменённых файлов: 2 добавлений и 5 удалений

Просмотреть файл

@ -124,8 +124,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale)
aLocale.SetString("C");
}
nsCOMPtr <nsIPosixLocale> posixLocale;
res = nsComponentManager::CreateInstance(kPosixLocaleFactoryCID, NULL, kIPosixLocaleIID, getter_AddRefs(posixLocale));
nsCOMPtr <nsIPosixLocale> posixLocale = do_GetService(kPosixLocaleFactoryCID, &res);
if (NS_SUCCEEDED(res)) {
char platformLocale[kPlatformLocaleLength+1];
res = posixLocale->GetPlatformLocale(&aLocale, platformLocale, kPlatformLocaleLength+1);
@ -134,9 +133,7 @@ nsresult nsCollationUnix::Initialize(nsILocale* locale)
}
}
nsCOMPtr <nsIPlatformCharset> platformCharset;
res = nsComponentManager::CreateInstance(kPlatformCharsetCID, NULL,
NS_GET_IID(nsIPlatformCharset), getter_AddRefs(platformCharset));
nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_PROGID, &res);
if (NS_SUCCEEDED(res)) {
PRUnichar* mappedCharset = NULL;
res = platformCharset->GetDefaultCharsetForLocale(aLocale.GetUnicode(), &mappedCharset);