Bug 443672 - Fix a few nits in nsStringBundle.cpp, r=smontagu

This commit is contained in:
Serge Gautherie 2008-07-09 22:21:24 +02:00
Родитель 98021bc457
Коммит 9bdbed401d
1 изменённых файлов: 15 добавлений и 22 удалений

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

@ -469,37 +469,30 @@ nsExtensibleStringBundle::~nsExtensibleStringBundle()
nsresult nsExtensibleStringBundle::GetStringFromID(PRInt32 aID, PRUnichar ** aResult)
{
nsresult rv;
PRUint32 size, i;
size = mBundles.Count();
for (i = 0; i < size; i++) {
const PRUint32 size = mBundles.Count();
for (PRUint32 i = 0; i < size; ++i) {
nsIStringBundle *bundle = mBundles[i];
if (bundle) {
rv = bundle->GetStringFromID(aID, aResult);
if (NS_SUCCEEDED(rv))
return NS_OK;
rv = bundle->GetStringFromID(aID, aResult);
if (NS_SUCCEEDED(rv))
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}
nsresult nsExtensibleStringBundle::GetStringFromName(const PRUnichar *aName,
nsresult nsExtensibleStringBundle::GetStringFromName(const PRUnichar *aName,
PRUnichar ** aResult)
{
nsresult res = NS_OK;
PRUint32 size, i;
size = mBundles.Count();
for (i = 0; i < size; i++) {
nsresult rv;
const PRUint32 size = mBundles.Count();
for (PRUint32 i = 0; i < size; ++i) {
nsIStringBundle* bundle = mBundles[i];
if (bundle) {
res = bundle->GetStringFromName(aName, aResult);
if (NS_SUCCEEDED(res))
return NS_OK;
rv = bundle->GetStringFromName(aName, aResult);
if (NS_SUCCEEDED(rv))
return NS_OK;
}
}
@ -747,14 +740,14 @@ nsStringBundleService::CreateBundle(const char* aURLSpec,
return getStringBundle(aURLSpec,aResult);
}
NS_IMETHODIMP
nsStringBundleService::CreateExtensibleBundle(const char* aCategory,
nsStringBundleService::CreateExtensibleBundle(const char* aCategory,
nsIStringBundle** aResult)
{
if (aResult == NULL) return NS_ERROR_NULL_POINTER;
nsresult res = NS_OK;
nsresult res;
nsExtensibleStringBundle * bundle = new nsExtensibleStringBundle();
if (!bundle) return NS_ERROR_OUT_OF_MEMORY;