зеркало из https://github.com/mozilla/gecko-dev.git
Fixed error handling and a typo.
This commit is contained in:
Родитель
6c9001419d
Коммит
33ed7eb1cd
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
static NS_DEFINE_IID(kICollationIID, NS_ICOLLATION_IID);
|
static NS_DEFINE_IID(kICollationIID, NS_ICOLLATION_IID);
|
||||||
static NS_DEFINE_IID(kMacLocaleFactoryCID, NS_MACLOCALEFACTORY_CID);
|
static NS_DEFINE_IID(kMacLocaleFactoryCID, NS_MACLOCALEFACTORY_CID);
|
||||||
static NS_DEFINE_IID(kIMacLocaleIID, NS_MACLOCALE_CID);
|
static NS_DEFINE_IID(kIMacLocaleIID, NS_IMACLOCALE_IID);
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -231,9 +231,8 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale,
|
||||||
stringOut.SetString(asctime(tmTime)); // set the default string, in case for API/conversion errors
|
stringOut.SetString(asctime(tmTime)); // set the default string, in case for API/conversion errors
|
||||||
|
|
||||||
// convert struct tm to input format of mac toolbox call
|
// convert struct tm to input format of mac toolbox call
|
||||||
NS_ASSERTION(tmTime->tm_year >= 0, "tm is not set correctly");
|
|
||||||
NS_ASSERTION(tmTime->tm_mon >= 0, "tm is not set correctly");
|
NS_ASSERTION(tmTime->tm_mon >= 0, "tm is not set correctly");
|
||||||
NS_ASSERTION(tmTime->tm_mday >= 0, "tm is not set correctly");
|
NS_ASSERTION(tmTime->tm_mday >= 1, "tm is not set correctly");
|
||||||
NS_ASSERTION(tmTime->tm_hour >= 0, "tm is not set correctly");
|
NS_ASSERTION(tmTime->tm_hour >= 0, "tm is not set correctly");
|
||||||
NS_ASSERTION(tmTime->tm_min >= 0, "tm is not set correctly");
|
NS_ASSERTION(tmTime->tm_min >= 0, "tm is not set correctly");
|
||||||
NS_ASSERTION(tmTime->tm_sec >= 0, "tm is not set correctly");
|
NS_ASSERTION(tmTime->tm_sec >= 0, "tm is not set correctly");
|
||||||
|
@ -262,20 +261,17 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale,
|
||||||
nsString aLocale;
|
nsString aLocale;
|
||||||
nsString aCategory("NSILOCALE_TIME");
|
nsString aCategory("NSILOCALE_TIME");
|
||||||
res = locale->GetCategory(aCategory.GetUnicode(), &aLocaleUnichar);
|
res = locale->GetCategory(aCategory.GetUnicode(), &aLocaleUnichar);
|
||||||
if (NS_FAILED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
return res;
|
aLocale.SetString(aLocaleUnichar);
|
||||||
}
|
//TODO: Get a charset name from a script code.
|
||||||
aLocale.SetString(aLocaleUnichar);
|
nsIMacLocale* macLocale;
|
||||||
|
short langcode;
|
||||||
//TODO: Get a charset name from a script code.
|
res = nsComponentManager::CreateInstance(kMacLocaleFactoryCID, NULL, kIMacLocaleIID, (void**)&macLocale);
|
||||||
nsIMacLocale* macLocale;
|
if (NS_SUCCEEDED(res)) {
|
||||||
short langcode;
|
res = macLocale->GetPlatformLocale(&aLocale, &scriptcode, &langcode);
|
||||||
res = nsComponentManager::CreateInstance(kMacLocaleFactoryCID, NULL, kIMacLocaleIID, (void**)&macLocale);
|
macLocale->Release();
|
||||||
if (NS_FAILED(res)) {
|
}
|
||||||
return res;
|
}
|
||||||
}
|
|
||||||
res = macLocale->GetPlatformLocale(&aLocale, &scriptcode, &langcode);
|
|
||||||
macLocale->Release();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle itl1Handle = (Handle) GetItl1Resource(scriptcode);
|
Handle itl1Handle = (Handle) GetItl1Resource(scriptcode);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче