From bcf7afd202bbf3634b44b0bf4b11b6372a1cb1dd Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Thu, 12 Sep 2002 19:09:19 +0000 Subject: [PATCH] api changes (bug 157097, r=cmanske, sr=sfraser) git-svn-id: svn://10.0.0.236/trunk@129377 18797224-902f-48f8-a5cc-f745e15eee43 --- .../composer/src/nsComposerController.cpp | 14 +++++++------ .../libeditor/base/nsEditorCommands.cpp | 20 +++++++++---------- .../editor/libeditor/base/nsEditorCommands.h | 2 +- .../libeditor/base/nsEditorController.cpp | 4 ++-- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/mozilla/editor/composer/src/nsComposerController.cpp b/mozilla/editor/composer/src/nsComposerController.cpp index 38290918ed2..128de73afcd 100644 --- a/mozilla/editor/composer/src/nsComposerController.cpp +++ b/mozilla/editor/composer/src/nsComposerController.cpp @@ -86,11 +86,13 @@ NS_IMETHODIMP nsComposerController::Init(nsISupports *aCommandRefCon) nsresult rv; // get our ref to the singleton command manager + // This will create mCommandManager and register commands if not already done. rv = GetComposerCommandManager(getter_AddRefs(mCommandManager)); if (NS_FAILED(rv)) return rv; mCommandRefCon = aCommandRefCon; // no addref - + + // the following (7?) lines can be removed when the JS commands are stateless and in C++ mCommandManager = do_CreateInstance(NS_CONTROLLERCOMMANDMANAGER_CONTRACTID, &rv); if (NS_FAILED(rv)) return rv; @@ -273,7 +275,7 @@ nsresult nsComposerController::GetComposerCommandManager(nsIControllerCommandMan } -//GetCommandState +// GetCommandStateWithParams /* cmd_bold,cmd_italic,cmd_underline ->state commands state_start : true,false @@ -281,16 +283,16 @@ state_end : true,false state_all : true,false state_mixed : true,false */ -/* void getCommandState (in DOMString aCommandName, inout nsICommandParams aCommandParams); */ -NS_IMETHODIMP nsComposerController::GetCommandState(const char *aCommand, nsICommandParams *aCommandParams) +/* void getCommandStateWithParams (in DOMString aCommandName, inout nsICommandParams aCommandParams); */ +NS_IMETHODIMP nsComposerController::GetCommandStateWithParams(const char *aCommand, nsICommandParams *aCommandParams) { if (!mCommandRefCon || !mCommandManager) return NS_ERROR_NOT_INITIALIZED; return mCommandManager->GetCommandState(aCommand,aCommandParams,mCommandRefCon); } -/* void doCommand (in DOMString aCommandName, in nsICommandParams aCommandParams); */ -NS_IMETHODIMP nsComposerController::DoCommand(const char *aCommand, nsICommandParams *aCommandParams) +/* void doCommandWithParams (in DOMString aCommandName, in nsICommandParams aCommandParams); */ +NS_IMETHODIMP nsComposerController::DoCommandWithParams(const char *aCommand, nsICommandParams *aCommandParams) { if (!mCommandRefCon || !mCommandManager) return NS_ERROR_NOT_INITIALIZED; diff --git a/mozilla/editor/libeditor/base/nsEditorCommands.cpp b/mozilla/editor/libeditor/base/nsEditorCommands.cpp index 38dc0d034f3..ad4324c247d 100644 --- a/mozilla/editor/libeditor/base/nsEditorCommands.cpp +++ b/mozilla/editor/libeditor/base/nsEditorCommands.cpp @@ -96,7 +96,7 @@ nsUndoCommand::DoCommandParams(const char *aCommandName, nsICommandParams *aPara } NS_IMETHODIMP -nsUndoCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsUndoCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -134,7 +134,7 @@ nsRedoCommand::DoCommandParams(const char *aCommandName, nsICommandParams *aPara } NS_IMETHODIMP -nsRedoCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsRedoCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -170,7 +170,7 @@ nsCutCommand::DoCommandParams(const char *aCommandName, nsICommandParams *aParam } NS_IMETHODIMP -nsCutCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsCutCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -215,7 +215,7 @@ nsCutOrDeleteCommand::DoCommandParams(const char *aCommandName, nsICommandParams } NS_IMETHODIMP -nsCutOrDeleteCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsCutOrDeleteCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -251,7 +251,7 @@ nsCopyCommand::DoCommandParams(const char *aCommandName, nsICommandParams *aPara } NS_IMETHODIMP -nsCopyCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsCopyCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -295,7 +295,7 @@ nsCopyOrDeleteCommand::DoCommandParams(const char *aCommandName, nsICommandParam } NS_IMETHODIMP -nsCopyOrDeleteCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsCopyOrDeleteCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -341,7 +341,7 @@ nsPasteCommand::DoCommandParams(const char *aCommandName, nsICommandParams *aPar } NS_IMETHODIMP -nsPasteCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsPasteCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -415,7 +415,7 @@ nsDeleteCommand::DoCommandParams(const char *aCommandName, nsICommandParams *aPa } NS_IMETHODIMP -nsDeleteCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsDeleteCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -451,7 +451,7 @@ nsSelectAllCommand::DoCommandParams(const char *aCommandName, nsICommandParams * } NS_IMETHODIMP -nsSelectAllCommand::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsSelectAllCommand::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); @@ -577,7 +577,7 @@ nsSelectionMoveCommands::DoCommandParams(const char *aCommandName, nsICommandPar } NS_IMETHODIMP -nsSelectionMoveCommands::GetCommandState(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) +nsSelectionMoveCommands::GetCommandStateParams(const char *aCommandName, nsICommandParams *aParams, nsISupports *aCommandRefCon) { PRBool canUndo; IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo); diff --git a/mozilla/editor/libeditor/base/nsEditorCommands.h b/mozilla/editor/libeditor/base/nsEditorCommands.h index fee383a2325..5634b392871 100644 --- a/mozilla/editor/libeditor/base/nsEditorCommands.h +++ b/mozilla/editor/libeditor/base/nsEditorCommands.h @@ -68,7 +68,7 @@ public: \ NS_IMETHOD IsCommandEnabled(const char * aCommandName, nsISupports *aCommandRefCon, PRBool *_retval); \ NS_IMETHOD DoCommand(const char *aCommandName, nsISupports *aCommandRefCon); \ NS_IMETHOD DoCommandParams(const char *aCommandName,nsICommandParams *aParams, nsISupports *aCommandRefCon); \ - NS_IMETHOD GetCommandState(const char *aCommandName,nsICommandParams *aParams, nsISupports *aCommandRefCon); \ + NS_IMETHOD GetCommandStateParams(const char *aCommandName,nsICommandParams *aParams, nsISupports *aCommandRefCon); \ }; diff --git a/mozilla/editor/libeditor/base/nsEditorController.cpp b/mozilla/editor/libeditor/base/nsEditorController.cpp index a0413bf222e..b61a3641702 100644 --- a/mozilla/editor/libeditor/base/nsEditorController.cpp +++ b/mozilla/editor/libeditor/base/nsEditorController.cpp @@ -208,12 +208,12 @@ NS_IMETHODIMP nsEditorController::DoCommand(const char *aCommand) return mCommandManager->DoCommand(aCommand, mCommandRefCon); } -NS_IMETHODIMP nsEditorController::DoCommand(const char *aCommand, nsICommandParams *aParams) +NS_IMETHODIMP nsEditorController::DoCommandWithParams(const char *aCommand, nsICommandParams *aParams) { return mCommandManager->DoCommandParams(aCommand, aParams, mCommandRefCon); } -NS_IMETHODIMP nsEditorController::GetCommandState(const char *aCommand, nsICommandParams *aParams) +NS_IMETHODIMP nsEditorController::GetCommandStateWithParams(const char *aCommand, nsICommandParams *aParams) { return mCommandManager->GetCommandState(aCommand, aParams, mCommandRefCon); }