зеркало из https://github.com/mozilla/pjs.git
Move collation init so layout doesn't get called recursively - fix balsa orange
This commit is contained in:
Родитель
be9aa23f63
Коммит
097bcbe7d0
|
@ -142,26 +142,6 @@ nsXULContentUtils::Init()
|
|||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
// get a locale service
|
||||
nsCOMPtr<nsILocaleService> localeService =
|
||||
do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsILocale> locale;
|
||||
rv = localeService->GetApplicationLocale(getter_AddRefs(locale));
|
||||
if (NS_SUCCEEDED(rv) && locale) {
|
||||
nsCOMPtr<nsICollationFactory> colFactory =
|
||||
do_CreateInstance(kCollationFactoryCID);
|
||||
if (colFactory) {
|
||||
rv = colFactory->CreateCollation(locale, &gCollation);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"couldn't create collation instance");
|
||||
} else
|
||||
NS_ERROR("couldn't create instance of collation factory");
|
||||
} else
|
||||
NS_ERROR("unable to get application locale");
|
||||
} else
|
||||
NS_ERROR("couldn't get locale factory");
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -187,6 +167,35 @@ nsXULContentUtils::Finish()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsICollation*
|
||||
nsXULContentUtils::GetCollation()
|
||||
{
|
||||
if (!gCollation) {
|
||||
nsresult rv;
|
||||
|
||||
// get a locale service
|
||||
nsCOMPtr<nsILocaleService> localeService =
|
||||
do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsILocale> locale;
|
||||
rv = localeService->GetApplicationLocale(getter_AddRefs(locale));
|
||||
if (NS_SUCCEEDED(rv) && locale) {
|
||||
nsCOMPtr<nsICollationFactory> colFactory =
|
||||
do_CreateInstance(kCollationFactoryCID);
|
||||
if (colFactory) {
|
||||
rv = colFactory->CreateCollation(locale, &gCollation);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv),
|
||||
"couldn't create collation instance");
|
||||
} else
|
||||
NS_ERROR("couldn't create instance of collation factory");
|
||||
} else
|
||||
NS_ERROR("unable to get application locale");
|
||||
} else
|
||||
NS_ERROR("couldn't get locale factory");
|
||||
}
|
||||
|
||||
return gCollation;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// nsIXULContentUtils methods
|
||||
|
|
|
@ -123,10 +123,7 @@ public:
|
|||
}
|
||||
|
||||
static nsICollation*
|
||||
GetCollation()
|
||||
{
|
||||
return gCollation;
|
||||
}
|
||||
GetCollation();
|
||||
|
||||
#define XUL_RESOURCE(ident, uri) static nsIRDFResource* ident
|
||||
#define XUL_LITERAL(ident, val) static nsIRDFLiteral* ident
|
||||
|
|
Загрузка…
Ссылка в новой задаче