rem:  dialog.topInput.value = print_margin_top * 0.001; dialog.bottomInput.value = print_margin_bottom * 0.001; dialog.leftInput.value = print_margin_left * 0.001; dialog.rightInput.value = print_margin_right * 0.001; 
add: dialog.topInput.value    = getDoubleStr(print_margin_top, 1); dialog.bottomInput.value = getDoubleStr(print_margin_bottom, 1); dialog.leftInput.value   = getDoubleStr(print_margin_left, 1); dialog.rightInput.value  = getDoubleStr(print_margin_right, 1); 
context: function loadDialog(){  var print_tofile = false;  var print_reversed = false;  var print_color = true;  var print_landscape = true;  var print_paper_size = 0;  var print_margin_top = 500;  var print_margin_left = 500;  var print_margin_bottom = 500;  var print_margin_right = 500;  var print_command = default_command;  var print_file = default_file;  var print_selection_radio_enabled = false;  try {    prefs = Components.classes["@mozilla.org/preferences;1"];    if (prefs) {      prefs = prefs.getService();      if (prefs)        prefs = prefs.QueryInterface(Components.interfaces.nsIPref);    }  } catch(e) { }  if (prefs) {    try { print_tofile = prefs.GetBoolPref("print.print_tofile"); } catch(e) { }    try { print_reversed = prefs.GetBoolPref("print.print_reversed"); } catch(e) { }    try { print_color = prefs.GetBoolPref("print.print_color"); } catch(e) { }    try { print_paper_size = prefs.GetIntPref("print.print_paper_size"); } catch(e) { }    //    // margins are set/get with the _js extention because we aren't converting them to twips    // the are multiplied by a 1000, i.e. 0.5 inches equals 500    //    try { print_margin_top = prefs.GetIntPref("print.print_margin_top_js"); } catch(e) { }    try { print_margin_left = prefs.GetIntPref("print.print_margin_left_js"); } catch(e) { }    try { print_margin_bottom = prefs.GetIntPref("print.print_margin_bottom_js"); } catch(e) { }    try { print_margin_right = prefs.GetIntPref("print.print_margin_right_js"); } catch(e) { }    try { print_command = prefs.CopyCharPref("print.print_command"); } catch(e) { }    try { print_file = prefs.CopyCharPref("print.print_file"); } catch(e) { }    try { print_tofile = prefs.GetBoolPref("print.print_tofile"); } catch(e) { }    try { print_selection_radio_enabled = prefs.GetBoolPref("print.selection_radio_enabled"); } catch(e) { }  }  if ( print_tofile == true) {    dialog.fileRadio.checked = true;    doPrintToFile( true );  } else {    dialog.printerRadio.checked = true;    doPrintToFile( false );  }  if ( print_color == true) {    dialog.colorRadio.checked = true;  } else {    dialog.grayRadio.checked = true;  }  if ( print_reversed == true) {    dialog.lastRadio.checked = true;  } else {    dialog.firstRadio.checked = true;  }  if ( print_paper_size == 0 ) {    dialog.letterRadio.checked = true;  } else if ( print_paper_size == 1 ) {    dialog.legalRadio.checked = true;  } else if ( print_paper_size == 2 ) {    dialog.exectiveRadio.checked = true;  } else if ( print_paper_size == 3 ) {    dialog.a4Radio.checked = true;  }  dialog.allpagesRadio.checked = true;  if ( print_selection_radio_enabled == true) {    dialog.selectionRadio.removeAttribute("disabled");   } else {    dialog.selectionRadio.setAttribute("disabled","true" );  }  doPrintRange(dialog.rangeRadio.checked);  dialog.frompageInput.value = 1;  dialog.topageInput.value   = 1;  // convert back to inches  dialog.topInput.value = print_margin_top * 0.001;  dialog.bottomInput.value = print_margin_bottom * 0.001;  dialog.leftInput.value = print_margin_left * 0.001;  dialog.rightInput.value = print_margin_right * 0.001;  dialog.cmdInput.value = print_command;  dialog.fileInput.value = print_file;  dialog.print.setAttribute("value",             document.getElementById("printButton").getAttribute("value"));}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/360737ebca996b8ce51b2aa00870f228f5abbdc8/printdialog.js/clean/xpfe/global/resources/content/unix/printdialog.js