зеркало из https://github.com/mozilla/pjs.git
Start controller IDs at 1 for InsertController. b=180814, r=brade, sr=sfraser
This commit is contained in:
Родитель
965ad6ed8e
Коммит
460f4e38f5
|
@ -162,7 +162,7 @@ nsXULControllers::GetControllerForCommand(const char *aCommand, nsIController**
|
|||
NS_IMETHODIMP
|
||||
nsXULControllers::InsertControllerAt(PRUint32 aIndex, nsIController *controller)
|
||||
{
|
||||
nsXULControllerData* controllerData = new nsXULControllerData(mCurControllerID++, controller);
|
||||
nsXULControllerData* controllerData = new nsXULControllerData(++mCurControllerID, controller);
|
||||
if (!controllerData) return NS_ERROR_OUT_OF_MEMORY;
|
||||
PRBool inserted = mControllers.InsertElementAt((void *)controllerData, aIndex);
|
||||
NS_ASSERTION(inserted, "Insertion of controller failed");
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
/* Implementations of nsIControllerCommand for composer commands */
|
||||
|
||||
var gComposerJSCommandControllerID = -1;
|
||||
var gComposerJSCommandControllerID = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
@ -132,6 +132,10 @@ function SetupTextEditorCommands()
|
|||
|
||||
function SetupComposerWindowCommands()
|
||||
{
|
||||
// Don't need to do this if already done
|
||||
if (gComposerWindowControllerID)
|
||||
return;
|
||||
|
||||
// Create a command controller and register commands
|
||||
// specific to Web Composer window (file-related commands, HTML Source...)
|
||||
// We can't use the composer controller created on the content window else
|
||||
|
@ -202,18 +206,18 @@ function SetupComposerWindowCommands()
|
|||
|
||||
// Store the controller ID so we can be sure to get the right one later
|
||||
gComposerWindowControllerID = windowControllers.getControllerId(editorController);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
function GetComposerCommandManager()
|
||||
{
|
||||
var controller;
|
||||
try {
|
||||
controller = window.controllers.getControllerById(gComposerJSCommandControllerID);
|
||||
} catch (e) {}
|
||||
|
||||
if (gComposerJSCommandControllerID)
|
||||
{
|
||||
try {
|
||||
controller = window.controllers.getControllerById(gComposerJSCommandControllerID);
|
||||
} catch (e) {}
|
||||
}
|
||||
if (!controller)
|
||||
{
|
||||
//create it
|
||||
|
|
Загрузка…
Ссылка в новой задаче