add: try { gPrintSettings = GetPrintSettings(); } catch(e) { gPrintSettings = PrintUtils.getPrintSettings(); }   
context: function BrowserPrintPreview(){  var ifreq;  var webBrowserPrint;    try {    ifreq = content.QueryInterface(Components.interfaces.nsIInterfaceRequestor);    webBrowserPrint = ifreq.getInterface(Components.interfaces.nsIWebBrowserPrint);         gPrintSettings = GetPrintSettings();  } catch (e) {    // Pressing cancel is expressed as an NS_ERROR_ABORT return value,    // causing an exception to be thrown which we catch here.    // Unfortunately this will also consume helpful failures, so add a    // dump(e); // if you need to debug  }  gWebProgress = new Object();  var printPreviewParams    = new Object();  var notifyOnOpen          = new Object();  var printingPromptService = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]                                  .getService(Components.interfaces.nsIPrintingPromptService);  if (printingPromptService) {    // just in case we are already printing,    // an error code could be returned if the Prgress Dialog is already displayed    try {      printingPromptService.showProgress(this, webBrowserPrint, gPrintSettings, gPrintPreviewObs, false, gWebProgress,                                         printPreviewParams, notifyOnOpen);      if (printPreviewParams.value) {        var webNav = getWebNavigation();        printPreviewParams.value.docTitle = webNav.document.title;        printPreviewParams.value.docURL   = webNav.currentURI.spec;      }      // this tells us whether we should continue on with PP or      // wait for the callback via the observer      if (!notifyOnOpen.value.valueOf() || gWebProgress.value == null) {        FinishPrintPreview();      }    } catch (e) {      FinishPrintPreview();    }  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/b216d4fa1649799201be5938da5cc2ebd57e3bb0/calPrintEngine.js/buggy/calendar/resources/content/calPrintEngine.js