rem: var useGlobalPrintSettings = true; var pref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); if (pref) { useGlobalPrintSettings = pref.getBoolPref("print.use_global_printsettings", false); } 
add: var useGlobalPrintSettings = gPrefBranch.getBoolPref("print.use_global_printsettings"); 
context: function GetPrintSettings(){  var prevPS = gPrintSettings;  try {    if (gPrintSettings == null) {      var useGlobalPrintSettings = true;      var pref = Components.classes["@mozilla.org/preferences-service;1"]                           .getService(Components.interfaces.nsIPrefBranch);      if (pref) {        useGlobalPrintSettings = pref.getBoolPref("print.use_global_printsettings", false);      }      // I would rather be using nsIWebBrowserPrint API      // but I really don't have a document at this point      var printSettingsService = Components.classes["@mozilla.org/gfx/printsettings-service;1"]                                           .getService(Components.interfaces.nsIPrintSettingsService);      if (useGlobalPrintSettings) {        gPrintSettings = printSettingsService.globalPrintSettings;      } else {        gPrintSettings = printSettingsService.CreatePrintSettings();      }    }  } catch (e) {    dump("GetPrintSettings "+e);  }  return gPrintSettings;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/7cb00076c55ebf89f74d18f62ce8512b7ca5846f/mailWindowOverlay.js/buggy/mailnews/base/resources/content/mailWindowOverlay.js