From 01ac4f0f8bb4775cc583dc0eef9759d52a4c8f71 Mon Sep 17 00:00:00 2001 From: "angelon%netscape.com" Date: Sun, 17 Nov 2002 10:43:42 +0000 Subject: [PATCH] Remerging from 1.2 (removing uneeded 1.0 code) git-svn-id: svn://10.0.0.236/branches/ANGELON_MOZ12_BRANCH@134003 18797224-902f-48f8-a5cc-f745e15eee43 --- .../composer/src/nsComposerCommands.cpp | 49 +++---------------- 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/mozilla/editor/composer/src/nsComposerCommands.cpp b/mozilla/editor/composer/src/nsComposerCommands.cpp index 3b3b87f2f47..1aa6ddad27e 100644 --- a/mozilla/editor/composer/src/nsComposerCommands.cpp +++ b/mozilla/editor/composer/src/nsComposerCommands.cpp @@ -106,30 +106,8 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsBaseStateUpdatingCommand, nsBaseComposerCommand); NS_IMETHODIMP nsBaseStateUpdatingCommand::IsCommandEnabled(const char *aCommandName, nsISupports *refCon, PRBool *outCmdEnabled) { - nsCOMPtr editor = do_QueryInterface(refCon); *outCmdEnabled = editor ? PR_TRUE : PR_FALSE; - - #if 0 - //this did not compile once merging onto the 1.2 branch. - //not sure if this is needed or not. - nsCOMPtr editorShell = do_QueryInterface(refCon); - *outCmdEnabled = PR_FALSE; - - if (editorShell && EditingHTML(editorShell)) - { - *outCmdEnabled = PR_TRUE; - // also udpate the command state. - UpdateCommandState(aCommandName, refCon); - } - else - { - nsCOMPtr editor = do_QueryInterface(refCon); - if (editor) - *outCmdEnabled = PR_TRUE; - } - #endif - return NS_OK; } @@ -311,7 +289,7 @@ nsStyleUpdatingCommand::GetCurrentState(nsIEditor *aEditor, const char* aTagName nsCOMPtr styleAtom = getter_AddRefs(NS_NewAtom(aTagName)); rv = htmlEditor->GetInlineProperty(styleAtom, NS_LITERAL_STRING(""), NS_LITERAL_STRING(""), &firstOfSelectionHasProp, &anyOfSelectionHasProp, &allOfSelectionHasProp); - outStyleSet = allOfSelectionHasProp; // change this to alter the behaviour + outStyleSet = allOfSelectionHasProp; // change this to alter the behaviour return rv; } @@ -621,12 +599,8 @@ nsIndentCommand::IsCommandEnabled(const char * aCommandName, nsISupports *refCon *outCmdEnabled = PR_TRUE; // can always indent (I guess) } else - { - nsCOMPtr editor = do_QueryInterface(refCon); - if (editor) - *outCmdEnabled = PR_TRUE; - } - + *outCmdEnabled = PR_FALSE; + return NS_OK; } @@ -686,17 +660,8 @@ nsOutdentCommand::IsCommandEnabled(const char * aCommandName, nsISupports *refCo *outCmdEnabled = canOutdent; } else - { - nsCOMPtr htmlEditor = do_QueryInterface(refCon); - if (htmlEditor) - { - PRBool canIndent, canOutdent; - htmlEditor->GetIndentState(&canIndent, &canOutdent); - - *outCmdEnabled = canOutdent; - } - } - + *outCmdEnabled = PR_FALSE; + return NS_OK; } @@ -1283,8 +1248,8 @@ nsRemoveStylesCommand::DoCommandParams(const char *aCommandName, nsICommandParam nsCOMPtr editor = do_QueryInterface(refCon); if (editor) editor->RemoveAllInlineProperties(); - - return DoCommand(aCommandName, refCon); + + return NS_OK; } NS_IMETHODIMP