Bug 1386600 - Change nsIStringBundle methods to return |AString| instead of |wstring|. r=emk,sr=dbaron.
This removes about 2/3 of the occurrences of nsXPIDLString in the tree. The places where nsXPIDLStrings are null-checked are replaced with |rv| checks. The patch also removes a couple of unused declarations from nsIStringBundle.idl. Note that nsStringBundle::GetStringFromNameHelper() was merged into GetStringFromName(), because they both would have had the same signature.
This commit is contained in:
@@ -288,9 +288,8 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
|
||||
rv = bundleService->CreateBundle(BRAND_PROPERTIES, getter_AddRefs(brandBundle));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsString brandShortName;
|
||||
brandBundle->GetStringFromName("brandShortName",
|
||||
getter_Copies(brandShortName));
|
||||
nsAutoString brandShortName;
|
||||
brandBundle->GetStringFromName("brandShortName", brandShortName);
|
||||
|
||||
// use brandShortName as the application id.
|
||||
NS_ConvertUTF16toUTF8 id(brandShortName);
|
||||
@@ -399,7 +398,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||
nsAutoCString filePath(PR_GetEnv("HOME"));
|
||||
|
||||
// get the product brand name from localized strings
|
||||
nsString brandName;
|
||||
nsAutoString brandName;
|
||||
nsCID bundleCID = NS_STRINGBUNDLESERVICE_CID;
|
||||
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(bundleCID));
|
||||
if (bundleService) {
|
||||
@@ -407,8 +406,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
||||
rv = bundleService->CreateBundle(BRAND_PROPERTIES,
|
||||
getter_AddRefs(brandBundle));
|
||||
if (NS_SUCCEEDED(rv) && brandBundle) {
|
||||
rv = brandBundle->GetStringFromName("brandShortName",
|
||||
getter_Copies(brandName));
|
||||
rv = brandBundle->GetStringFromName("brandShortName", brandName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user