add:  var prefs = Components.classes['component: if (prefs) { prefs = prefs.getService(); } if (prefs) { prefs = prefs.QueryInterface(Components.interfaces.nsIPref); } if (prefs) { dump(" We found the Prefs Service\n"); var percent; var height; var shading; var ud = "undefined";  try { var align = prefs.GetIntPref("editor.hrule.align"); dump("Align pref: "+align+"\n"); if (align == 0 ) { hLine.setAttribute("align", "left"); } else if (align == 2) { hLine.setAttribute("align", "right"); } else  {  hLine.setAttribute("align", "center"); }  var width = prefs.GetIntPref("editor.hrule.width"); var percent = prefs.GetBoolPref("editor.hrule.width_percent"); dump("Width pref: "+width+", percent:"+percent+"\n"); if (percent) width = width +"%";  hLine.setAttribute("width", width);  var height = prefs.GetIntPref("editor.hrule.height"); dump("Size pref: "+height+"\n"); hLine.setAttribute("size", String(height));  var shading = prefs.GetBoolPref("editor.hrule.shading"); dump("Shading pref:"+shading+"\n"); if (shading) { hLine.removeAttribute("noshade"); } else { hLine.setAttribute("noshade", ""); } } catch (ex) { dump("failed to get HLine prefs\n"); } } 
context: function EditorInsertHLine(){  // Inserting an HLine is different in that we don't use properties dialog  //  unless we are editing an existing line's attributes  //  We get the last-used attributes from the prefs and insert immediately  tagName = "hr";  hLine = editorShell.GetSelectedElement(tagName);  if (hLine) {    // We only open the dialog for an existing HRule    window.openDialog("chrome://editor/content/EdHLineProps.xul", "HLineDlg", "chrome,close,titlebar,modal");  } else {    hLine = editorShell.CreateElementWithDefaults(tagName);    if (hLine) {      editorShell.InsertElement(hLine, false);    }  }  contentWindow.focus();}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ce2856a9e0e7fb88faa999c0abd04dd7e0a9a110/EditorCommands.js/buggy/editor/ui/composer/content/EditorCommands.js