rem: var controller = window.controllers.getControllerAt(i);  var interfaceRequestor = controller.QueryInterface(Components.interfaces.nsIInterfaceRequestor); commandManager = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandManager); if (commandManager) { i = -1; editorController = controller.QueryInterface(Components.interfaces.nsIEditorController); } } catch(ex) { } }   if (editorController) { var ISupportsEditor; try { ISupportsEditor = aEditor.QueryInterface(Components.interfaces.nsISupports); editorController.SetCommandRefCon(ISupportsEditor); 
add: var controller = window.controllers.getControllerById(gComposerWindowControllerID); controller.SetCommandRefCon(aEditor.QueryInterface(Components.interfaces.nsISupports)); 
context: function DoWindowCommandControllerSetting(aEditor){  // the following is similar to GetEditorController() in ComposerCommands.js but we need   // the nsIEditorController not the nsIControllerCommandManager  // Also note that it gets the controllers from the window not window._content  var editorController;  var numControllers = window.controllers.getControllerCount();      // count down to find a controller that supplies a nsIControllerCommandManager interface  for (var i = numControllers-1; i >= 0 ; i --)  {    var commandManager = null;        try {       var controller = window.controllers.getControllerAt(i);            var interfaceRequestor = controller.QueryInterface(Components.interfaces.nsIInterfaceRequestor);      commandManager = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandManager);      if (commandManager)      {        i = -1;  // get out of loop        editorController = controller.QueryInterface(Components.interfaces.nsIEditorController);      }    }    catch(ex) { }  }  // if we find an editor controller, set the command refcon to the editor  if (editorController)  {    var ISupportsEditor;    try {      ISupportsEditor = aEditor.QueryInterface(Components.interfaces.nsISupports);      editorController.SetCommandRefCon(ISupportsEditor);    } catch (e) {}  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/1010f8aeed1d47f0f0a00649c46266c1855c197c/editor.js/buggy/editor/ui/composer/content/editor.js