Merge pull request #8172 from Snuffleupagus/bug-1345294
Upstream the changes from bug 1345294 - nsIPrefBranch should have methods to get/set unicode strings
This commit is contained in:
commit
b2ed788ea3
@ -93,7 +93,12 @@ function getIntPref(pref, def) {
|
||||
|
||||
function getStringPref(pref, def) {
|
||||
try {
|
||||
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
||||
//#if !MOZCENTRAL
|
||||
if (!Services.prefs.getStringPref) {
|
||||
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
||||
}
|
||||
//#endif
|
||||
return Services.prefs.getStringPref(pref);
|
||||
} catch (ex) {
|
||||
return def;
|
||||
}
|
||||
|
@ -273,10 +273,16 @@ var PdfjsChromeUtils = {
|
||||
|
||||
_setStringPref(aPrefName, aPrefValue) {
|
||||
this._ensurePreferenceAllowed(aPrefName);
|
||||
let str = Cc["@mozilla.org/supports-string;1"]
|
||||
.createInstance(Ci.nsISupportsString);
|
||||
str.data = aPrefValue;
|
||||
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
|
||||
//#if !MOZCENTRAL
|
||||
if (!Services.prefs.setStringPref) {
|
||||
let str = Cc["@mozilla.org/supports-string;1"]
|
||||
.createInstance(Ci.nsISupportsString);
|
||||
str.data = aPrefValue;
|
||||
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
Services.prefs.setStringPref(aPrefName, aPrefValue);
|
||||
},
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user