rem: if (gPrintSettings) { 
add: if (gPrintSettings != null) { 
context: function onAccept(){  if (gPrintSettings) {    var print_howToEnableUI = gPrintSetInterface.kFrameEnableNone;    var stringBundle = srGetStrBundle("chrome://global/locale/printing.properties");    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]                        .getService(Components.interfaces.nsIPromptService);    if (dialog.fileRadio.selected && dialog.fileInput.value == "") {      var titleText = stringBundle.GetStringFromName("noPrintFilename.title");      var alertText = stringBundle.GetStringFromName("noPrintFilename.alert");      promptService.alert(this.window, titleText, alertText);      return false;    }    // save these out so they can be picked up by the device spec    gPrintSettings.printToFile = dialog.fileRadio.selected;    print_howToEnableUI        = gPrintSettings.howToEnableFrameUI;    // save these out so they can be picked up by the device spec    gPrintSettings.toFileName   = dialog.fileInput.value;    gPrintSettings.printerName  = dialog.printerList.value;    if (gPrintSettings.printToFile) {      if (gPrintSettings.toFileName == "")        return false;      var sfile = Components.classes["@mozilla.org/file/local;1"]                  .createInstance(Components.interfaces.nsILocalFile);      sfile.initWithPath(gPrintSettings.toFileName);      if (sfile.exists() &&        gPrintSettings.toFileName != gFileFromPicker) {        var desc = stringBundle.formatStringFromName("fileConfirm.exists",                                                     [gPrintSettings.toFileName],                                                     1);        if (!promptService.confirm(this.window, null, desc)) {          return false;        }      }    }    if (dialog.allpagesRadio.selected) {      gPrintSettings.printRange = gPrintSetInterface.kRangeAllPages;    } else if (dialog.rangeRadio.selected) {      gPrintSettings.printRange = gPrintSetInterface.kRangeSpecifiedPageRange;    } else if (dialog.selectionRadio.selected) {      gPrintSettings.printRange = gPrintSetInterface.kRangeSelection;    }    gPrintSettings.startPageRange = dialog.frompageInput.value;    gPrintSettings.endPageRange   = dialog.topageInput.value;    gPrintSettings.numCopies      = dialog.numCopiesInput.value;    var frametype = gPrintSetInterface.kNoFrames;    if (print_howToEnableUI != gPrintSetInterface.kFrameEnableNone) {      if (dialog.aslaidoutRadio.selected) {        frametype = gPrintSetInterface.kFramesAsIs;      } else if (dialog.selectedframeRadio.selected) {        frametype = gPrintSetInterface.kSelectedFrame;      } else if (dialog.eachframesepRadio.selected) {        frametype = gPrintSetInterface.kEachFrameSep;      } else {        frametype = gPrintSetInterface.kSelectedFrame;      }    }    gPrintSettings.printFrameType = frametype;    if (doDebug) {      dump("onAccept*********************************************\n");      dump("frametype      "+frametype+"\n");      dump("numCopies      "+gPrintSettings.numCopies+"\n");      dump("printRange     "+gPrintSettings.printRange+"\n");      dump("printerName    "+gPrintSettings.printerName+"\n");      dump("startPageRange "+gPrintSettings.startPageRange+"\n");      dump("endPageRange   "+gPrintSettings.endPageRange+"\n");      dump("printToFile    "+gPrintSettings.printToFile+"\n");    }  }  if (printService) {    var flags = gPrintSetInterface.kInitSavePaperSizeType |                 gPrintSetInterface.kInitSavePaperSizeUnit |                gPrintSetInterface.kInitSavePaperWidth    |                 gPrintSetInterface.kInitSavePaperHeight   |                gPrintSetInterface.kInitSavePaperName     |                 gPrintSetInterface.kInitSaveInColor       |                gPrintSetInterface.kInitSavePrintCommand;    printService.savePrintSettingsToPrefs(gPrintSettings, true, flags);  }  // set return value to "print"  if (paramBlock) {    paramBlock.SetInt(0, 1);  } else {    dump("*** FATAL ERROR: No paramBlock\n");  }  return true;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/55783de2dd491d6b7010f2a174c6265de791eec6/printdialog.js/clean/toolkit/components/printing/content/printdialog.js