rem:   var printername = gPrintSettings.printerName; dialog.topInput.value    = gPrefs.getIntPref("print."+printername+"print_edge_top") / 100.0; dialog.bottomInput.value = gPrefs.getIntPref("print."+printername+"print_edge_left") / 100.0; dialog.leftInput.value   = gPrefs.getIntPref("print."+printername+"print_edge_right") / 100.0; dialog.rightInput.value  = gPrefs.getIntPref("print."+printername+"print_edge_bottom") / 100.0; 
context: function loadDialog(){  var print_paper_type       = 0;  var print_paper_unit       = 0;  var print_paper_width      = 0.0;  var print_paper_height     = 0.0;  var print_paper_width_mm   = 0.0;  var print_paper_height_mm  = 0.0;    var print_color            = true;  var print_command          = default_command;  gPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);  if (gPrintSettings) {    print_paper_type   = gPrintSettings.paperSizeType;    print_paper_unit   = gPrintSettings.paperSizeUnit;    print_paper_width  = gPrintSettings.paperWidth;    print_paper_height = gPrintSettings.paperHeight;    print_color        = gPrintSettings.printInColor;    print_command      = gPrintSettings.printCommand;        if (print_paper_unit == gPrintSettingsInterface.kPaperSizeInches) {      print_paper_width_mm  = gPrintSettings.paperWidth  * 25.4;      print_paper_height_mm = gPrintSettings.paperHeight * 25.4;    }    else if (print_paper_unit == gPrintSettingsInterface.kPaperSizeMillimeters) {      print_paper_width_mm  = gPrintSettings.paperWidth;      print_paper_height_mm = gPrintSettings.paperHeight;    }    else {      dump("Unknown value in gPrintSettings.paperSizeUnit");    }  }  if (doDebug) {    dump("loadDialog******************************\n");    dump("paperSizeType "+print_paper_unit+"\n");    dump("paperWidth    "+print_paper_width+"\n");    dump("paperHeight   "+print_paper_height+"\n");    dump("printInColor  "+print_color+"\n");    dump("printCommand  "+print_command+"\n");  }  createPaperArray();  var selectedInx = 0;  var tolerance = 10.0; // 4 is usually enougth except for large papers like DIN-A3  for (var i=0;i<gPaperArray.length;i++) {     // Weak match. Allow errors up to +/- 5mm due rounding errors    if ((Math.abs(print_paper_width_mm  - gPaperArray[i].width_mm)  <= tolerance) &&         (Math.abs(print_paper_height_mm - gPaperArray[i].height_mm) <= tolerance)) {      selectedInx = i;      break;    }  }    if (doDebug) {    if (i == gPaperArray.length)      dump("loadDialog: No paper found.\n");  }  createPaperSizeList(selectedInx);  if (print_command == "") {    print_command = default_command;  }  if (print_color) {    dialog.colorGroup.selectedItem = dialog.colorRadio;  } else {    dialog.colorGroup.selectedItem = dialog.grayRadio;  }  dialog.cmdInput.value = print_command;  try {    // first get the generic settings    dialog.topInput.value    = gPrefs.getIntPref("print.print_edge_top") / 100.0;    dialog.bottomInput.value = gPrefs.getIntPref("print.print_edge_left") / 100.0;    dialog.leftInput.value   = gPrefs.getIntPref("print.print_edge_right") / 100.0;    dialog.rightInput.value  = gPrefs.getIntPref("print.print_edge_bottom") / 100.0;    // then the printer specific settings    var printername = gPrintSettings.printerName;    dialog.topInput.value    = gPrefs.getIntPref("print."+printername+"print_edge_top") / 100.0;    dialog.bottomInput.value = gPrefs.getIntPref("print."+printername+"print_edge_left") / 100.0;    dialog.leftInput.value   = gPrefs.getIntPref("print."+printername+"print_edge_right") / 100.0;    dialog.rightInput.value  = gPrefs.getIntPref("print."+printername+"print_edge_bottom") / 100.0;  } catch (e) {    dialog.topInput.value    = "0.04";    dialog.bottomInput.value = "0.04";    dialog.leftInput.value   = "0.04";    dialog.rightInput.value  = "0.04";  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/9e6a587a72175b54a94ee0d9cd5f214dd11c6437/printjoboptions.js/buggy/xpfe/global/resources/content/unix/printjoboptions.js