зеркало из https://github.com/mozilla/pjs.git
Bug 443672 - Fix a few nits in nsStringBundle.cpp, r=smontagu
This commit is contained in:
Родитель
98021bc457
Коммит
9bdbed401d
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче