Bug 1381410 (part 3) - Simplify nsExtensibleStringBundle::GetStringFromID(). r=emk.

Similar to the previous patch, this patch changes GetStringFromID() to call
GetStringFromName(), but this time in nsExtensibleStringBundle.

--HG--
extra : rebase_source : 38b12f5f0010396b2606969fb0c7baef96debe21
This commit is contained in:
Nicholas Nethercote 2017-07-17 18:34:31 +10:00
parent e33bd03721
commit cd092e2d5d

View File

@ -138,7 +138,6 @@ nsStringBundle::FormatStringFromID(int32_t aID,
{
nsAutoCString idStr;
idStr.AppendInt(aID, 10);
return FormatStringFromName(idStr.get(), aParams, aLength, aResult);
}
@ -392,18 +391,9 @@ nsExtensibleStringBundle::~nsExtensibleStringBundle()
nsresult nsExtensibleStringBundle::GetStringFromID(int32_t aID, char16_t ** aResult)
{
nsresult rv;
const uint32_t size = mBundles.Count();
for (uint32_t i = 0; i < size; ++i) {
nsIStringBundle *bundle = mBundles[i];
if (bundle) {
rv = bundle->GetStringFromID(aID, aResult);
if (NS_SUCCEEDED(rv))
return NS_OK;
}
}
return NS_ERROR_FAILURE;
nsAutoCString idStr;
idStr.AppendInt(aID, 10);
return GetStringFromName(idStr.get(), aResult);
}
nsresult nsExtensibleStringBundle::GetStringFromAUTF8Name(