зеркало из https://github.com/mozilla/pjs.git
Changed to use do_GetService instead of CreateInstance, bug 30203, r=cata.
This commit is contained in:
Родитель
fdcf455115
Коммит
ace08e002d
|
@ -168,18 +168,14 @@ nsresult nsCollationMac::Initialize(nsILocale* locale)
|
|||
nsAllocator::Free(aLocaleUnichar);
|
||||
|
||||
short scriptcode, langcode, regioncode;
|
||||
nsCOMPtr <nsIMacLocale> macLocale;
|
||||
res = nsComponentManager::CreateInstance(kMacLocaleFactoryCID, NULL,
|
||||
NS_GET_IID(nsIMacLocale), getter_AddRefs(macLocale));
|
||||
nsCOMPtr <nsIMacLocale> macLocale = do_GetService(kMacLocaleFactoryCID, &res);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
if (NS_SUCCEEDED(res = macLocale->GetPlatformLocale(&aLocale, &scriptcode, &langcode, ®ioncode))) {
|
||||
m_scriptcode = scriptcode;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -276,16 +276,12 @@ nsresult nsDateTimeFormatMac::Initialize(nsILocale* locale)
|
|||
mLocale.SetString(aLocaleUnichar); // cache locale name
|
||||
nsAllocator::Free(aLocaleUnichar);
|
||||
|
||||
nsCOMPtr <nsIMacLocale> macLocale;
|
||||
res = nsComponentManager::CreateInstance(kMacLocaleFactoryCID, NULL,
|
||||
NS_GET_IID(nsIMacLocale), getter_AddRefs(macLocale));
|
||||
nsCOMPtr <nsIMacLocale> macLocale = do_GetService(kMacLocaleFactoryCID, &res);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = macLocale->GetPlatformLocale(&mLocale, &mScriptcode, &mLangcode, &mRegioncode);
|
||||
}
|
||||
|
||||
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(mLocale.GetUnicode(), &mappedCharset);
|
||||
|
|
|
@ -111,8 +111,7 @@ nsresult nsCollationWin::Initialize(nsILocale* locale)
|
|||
nsAllocator::Free(aLocaleUnichar);
|
||||
}
|
||||
|
||||
nsCOMPtr <nsIWin32Locale> win32Locale;
|
||||
res = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID, NULL, kIWin32LocaleIID, getter_AddRefs(win32Locale));
|
||||
nsCOMPtr <nsIWin32Locale> win32Locale = do_GetService(kWin32LocaleFactoryCID, &res);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
LCID lcid;
|
||||
res = win32Locale->GetPlatformLocale(&aLocale, &lcid);
|
||||
|
@ -121,9 +120,7 @@ nsresult nsCollationWin::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);
|
||||
|
|
|
@ -115,15 +115,12 @@ nsresult nsDateTimeFormatWin::Initialize(nsILocale* locale)
|
|||
mLocale.Assign(aLocaleUnichar); // cache locale name
|
||||
nsAllocator::Free(aLocaleUnichar);
|
||||
|
||||
nsCOMPtr <nsIWin32Locale> win32Locale;
|
||||
res = nsComponentManager::CreateInstance(kWin32LocaleFactoryCID, NULL, kIWin32LocaleIID, getter_AddRefs(win32Locale));
|
||||
nsCOMPtr <nsIWin32Locale> win32Locale = do_GetService(kWin32LocaleFactoryCID, &res);
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = win32Locale->GetPlatformLocale(&mLocale, (LCID *) &mLCID);
|
||||
}
|
||||
|
||||
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(mLocale.GetUnicode(), &mappedCharset);
|
||||
|
|
Загрузка…
Ссылка в новой задаче