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) {
|
function getStringPref(pref, def) {
|
||||||
try {
|
try {
|
||||||
|
//#if !MOZCENTRAL
|
||||||
|
if (!Services.prefs.getStringPref) {
|
||||||
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
return Services.prefs.getStringPref(pref);
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
@ -273,10 +273,16 @@ var PdfjsChromeUtils = {
|
|||||||
|
|
||||||
_setStringPref(aPrefName, aPrefValue) {
|
_setStringPref(aPrefName, aPrefValue) {
|
||||||
this._ensurePreferenceAllowed(aPrefName);
|
this._ensurePreferenceAllowed(aPrefName);
|
||||||
|
//#if !MOZCENTRAL
|
||||||
|
if (!Services.prefs.setStringPref) {
|
||||||
let str = Cc["@mozilla.org/supports-string;1"]
|
let str = Cc["@mozilla.org/supports-string;1"]
|
||||||
.createInstance(Ci.nsISupportsString);
|
.createInstance(Ci.nsISupportsString);
|
||||||
str.data = aPrefValue;
|
str.data = aPrefValue;
|
||||||
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
|
Services.prefs.setComplexValue(aPrefName, Ci.nsISupportsString, str);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
Services.prefs.setStringPref(aPrefName, aPrefValue);
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user