Bug 1101392 - Part 1: Fix coding style in nsEditorCommands.cpp. r=roc
authorMorris Tseng <mtseng@mozilla.com>
Mon, 24 Nov 2014 22:08:00 +0100
changeset 242274 5813ab25249c2a386507946b35c5ebf0990f766c
parent 242273 f3035a182cfed217b823ddeae1971a8dc6fedbe1
child 242275 f32ac17514553f657a83bde3be12e8f8ca0ef433
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1101392
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1101392 - Part 1: Fix coding style in nsEditorCommands.cpp. r=roc
editor/libeditor/nsEditorCommands.cpp
--- a/editor/libeditor/nsEditorCommands.cpp
+++ b/editor/libeditor/nsEditorCommands.cpp
@@ -1,14 +1,13 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-
 #include "mozFlushType.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Assertions.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "nsDebug.h"
 #include "nsEditorCommands.h"
 #include "nsError.h"
@@ -23,462 +22,441 @@
 #include "nsISelection.h"
 #include "nsISelectionController.h"
 #include "nsITransferable.h"
 #include "nsString.h"
 #include "nsAString.h"
 
 class nsISupports;
 
-
-#define STATE_ENABLED  "state_enabled"
+#define STATE_ENABLED "state_enabled"
 #define STATE_DATA "state_data"
 
-
-nsBaseEditorCommand::nsBaseEditorCommand()
-{
-}
+nsBaseEditorCommand::nsBaseEditorCommand() {}
 
 NS_IMPL_ISUPPORTS(nsBaseEditorCommand, nsIControllerCommand)
 
-
 NS_IMETHODIMP
-nsUndoCommand::IsCommandEnabled(const char * aCommandName, 
-                                nsISupports *aCommandRefCon, 
+nsUndoCommand::IsCommandEnabled(const char *aCommandName,
+                                nsISupports *aCommandRefCon,
                                 bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     bool isEnabled, isEditable = false;
     nsresult rv = editor->GetIsSelectionEditable(&isEditable);
     NS_ENSURE_SUCCESS(rv, rv);
     if (isEditable)
       return editor->CanUndo(&isEnabled, outCmdEnabled);
   }
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsUndoCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->Undo(1);
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsUndoCommand::DoCommandParams(const char *aCommandName,
                                nsICommandParams *aParams,
                                nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsUndoCommand::GetCommandStateParams(const char *aCommandName,
                                      nsICommandParams *aParams,
                                      nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
-nsRedoCommand::IsCommandEnabled(const char * aCommandName,
+nsRedoCommand::IsCommandEnabled(const char *aCommandName,
                                 nsISupports *aCommandRefCon,
                                 bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     bool isEnabled, isEditable = false;
     nsresult rv = editor->GetIsSelectionEditable(&isEditable);
     NS_ENSURE_SUCCESS(rv, rv);
     if (isEditable)
       return editor->CanRedo(&isEnabled, outCmdEnabled);
   }
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsRedoCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->Redo(1);
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsRedoCommand::DoCommandParams(const char *aCommandName,
                                nsICommandParams *aParams,
                                nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsRedoCommand::GetCommandStateParams(const char *aCommandName,
                                      nsICommandParams *aParams,
                                      nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
-nsClearUndoCommand::IsCommandEnabled(const char * aCommandName,
+nsClearUndoCommand::IsCommandEnabled(const char *aCommandName,
                                      nsISupports *refCon, bool *outCmdEnabled)
-{ 
+{
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   if (editor)
     return editor->GetIsSelectionEditable(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_OK;
 }
-  
 
 NS_IMETHODIMP
 nsClearUndoCommand::DoCommand(const char *aCommandName, nsISupports *refCon)
-{ 
+{
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_NOT_IMPLEMENTED);
-  
-  editor->EnableUndo(false);  // Turning off undo clears undo/redo stacks.
-  editor->EnableUndo(true);   // This re-enables undo/redo.
-  
+
+  editor->EnableUndo(false); // Turning off undo clears undo/redo stacks.
+  editor->EnableUndo(true);  // This re-enables undo/redo.
+
   return NS_OK;
 }
-                                  
-NS_IMETHODIMP                       
+
+NS_IMETHODIMP
 nsClearUndoCommand::DoCommandParams(const char *aCommandName,
                                     nsICommandParams *aParams,
                                     nsISupports *refCon)
 {
   return DoCommand(aCommandName, refCon);
 }
-                                                  
-NS_IMETHODIMP                                     
+
+NS_IMETHODIMP
 nsClearUndoCommand::GetCommandStateParams(const char *aCommandName,
                                           nsICommandParams *aParams,
                                           nsISupports *refCon)
-{ 
+{
   NS_ENSURE_ARG_POINTER(aParams);
-  
+
   bool enabled;
   nsresult rv = IsCommandEnabled(aCommandName, refCon, &enabled);
   NS_ENSURE_SUCCESS(rv, rv);
-   
+
   return aParams->SetBooleanValue(STATE_ENABLED, enabled);
 }
 
 NS_IMETHODIMP
-nsCutCommand::IsCommandEnabled(const char * aCommandName,
-                               nsISupports *aCommandRefCon,
-                               bool *outCmdEnabled)
+nsCutCommand::IsCommandEnabled(const char *aCommandName,
+                               nsISupports *aCommandRefCon, bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     bool isEditable = false;
     nsresult rv = editor->GetIsSelectionEditable(&isEditable);
     NS_ENSURE_SUCCESS(rv, rv);
     if (isEditable)
       return editor->CanCut(outCmdEnabled);
   }
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsCutCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->Cut();
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCutCommand::DoCommandParams(const char *aCommandName,
                               nsICommandParams *aParams,
                               nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCutCommand::GetCommandStateParams(const char *aCommandName,
                                     nsICommandParams *aParams,
                                     nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
-
 NS_IMETHODIMP
-nsCutOrDeleteCommand::IsCommandEnabled(const char * aCommandName,
+nsCutOrDeleteCommand::IsCommandEnabled(const char *aCommandName,
                                        nsISupports *aCommandRefCon,
                                        bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->GetIsSelectionEditable(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsCutOrDeleteCommand::DoCommand(const char *aCommandName,
                                 nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     nsCOMPtr<nsISelection> selection;
     nsresult rv = editor->GetSelection(getter_AddRefs(selection));
     if (NS_SUCCEEDED(rv) && selection && selection->Collapsed()) {
       return editor->DeleteSelection(nsIEditor::eNext, nsIEditor::eStrip);
     }
     return editor->Cut();
   }
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCutOrDeleteCommand::DoCommandParams(const char *aCommandName,
                                       nsICommandParams *aParams,
                                       nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCutOrDeleteCommand::GetCommandStateParams(const char *aCommandName,
                                             nsICommandParams *aParams,
                                             nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
-nsCopyCommand::IsCommandEnabled(const char * aCommandName,
+nsCopyCommand::IsCommandEnabled(const char *aCommandName,
                                 nsISupports *aCommandRefCon,
                                 bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->CanCopy(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsCopyCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->Copy();
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCopyCommand::DoCommandParams(const char *aCommandName,
                                nsICommandParams *aParams,
                                nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCopyCommand::GetCommandStateParams(const char *aCommandName,
                                      nsICommandParams *aParams,
                                      nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
-nsCopyOrDeleteCommand::IsCommandEnabled(const char * aCommandName,
+nsCopyOrDeleteCommand::IsCommandEnabled(const char *aCommandName,
                                         nsISupports *aCommandRefCon,
                                         bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->GetIsSelectionEditable(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsCopyOrDeleteCommand::DoCommand(const char *aCommandName,
                                  nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     nsCOMPtr<nsISelection> selection;
     nsresult rv = editor->GetSelection(getter_AddRefs(selection));
     if (NS_SUCCEEDED(rv) && selection && selection->Collapsed()) {
       return editor->DeleteSelection(nsIEditor::eNextWord, nsIEditor::eStrip);
     }
     return editor->Copy();
   }
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCopyOrDeleteCommand::DoCommandParams(const char *aCommandName,
                                        nsICommandParams *aParams,
                                        nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsCopyOrDeleteCommand::GetCommandStateParams(const char *aCommandName,
                                              nsICommandParams *aParams,
                                              nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
 nsPasteCommand::IsCommandEnabled(const char *aCommandName,
                                  nsISupports *aCommandRefCon,
                                  bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     bool isEditable = false;
     nsresult rv = editor->GetIsSelectionEditable(&isEditable);
     NS_ENSURE_SUCCESS(rv, rv);
     if (isEditable)
       return editor->CanPaste(nsIClipboard::kGlobalClipboard, outCmdEnabled);
   }
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsPasteCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
-  
+
   return editor->Paste(nsIClipboard::kGlobalClipboard);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsPasteCommand::DoCommandParams(const char *aCommandName,
                                 nsICommandParams *aParams,
                                 nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsPasteCommand::GetCommandStateParams(const char *aCommandName,
                                       nsICommandParams *aParams,
                                       nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
 nsPasteTransferableCommand::IsCommandEnabled(const char *aCommandName,
                                              nsISupports *aCommandRefCon,
                                              bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
-  if (editor)
-  {
+  if (editor) {
     bool isEditable = false;
     nsresult rv = editor->GetIsSelectionEditable(&isEditable);
     NS_ENSURE_SUCCESS(rv, rv);
     if (isEditable)
       return editor->CanPasteTransferable(nullptr, outCmdEnabled);
   }
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsPasteTransferableCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
+nsPasteTransferableCommand::DoCommand(const char *aCommandName,
+                                      nsISupports *aCommandRefCon)
 {
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsPasteTransferableCommand::DoCommandParams(const char *aCommandName,
                                             nsICommandParams *aParams,
                                             nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
-  
+
   nsCOMPtr<nsISupports> supports;
   aParams->GetISupportsValue("transferable", getter_AddRefs(supports));
   NS_ENSURE_TRUE(supports, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsITransferable> trans = do_QueryInterface(supports);
   NS_ENSURE_TRUE(trans, NS_ERROR_FAILURE);
 
   return editor->PasteTransferable(trans);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsPasteTransferableCommand::GetCommandStateParams(const char *aCommandName,
                                                   nsICommandParams *aParams,
                                                   nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsITransferable> trans;
@@ -494,59 +472,60 @@ nsPasteTransferableCommand::GetCommandSt
   nsresult rv = editor->CanPasteTransferable(trans, &canPaste);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return aParams->SetBooleanValue(STATE_ENABLED, canPaste);
 }
 
 NS_IMETHODIMP
 nsSwitchTextDirectionCommand::IsCommandEnabled(const char *aCommandName,
-                                 nsISupports *aCommandRefCon,
-                                 bool *outCmdEnabled)
+                                               nsISupports *aCommandRefCon,
+                                               bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->GetIsSelectionEditable(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSwitchTextDirectionCommand::DoCommand(const char *aCommandName, nsISupports *aCommandRefCon)
+nsSwitchTextDirectionCommand::DoCommand(const char *aCommandName,
+                                        nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
 
   return editor->SwitchTextDirection();
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSwitchTextDirectionCommand::DoCommandParams(const char *aCommandName,
-                                nsICommandParams *aParams,
-                                nsISupports *aCommandRefCon)
+                                              nsICommandParams *aParams,
+                                              nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSwitchTextDirectionCommand::GetCommandStateParams(const char *aCommandName,
-                                      nsICommandParams *aParams,
-                                      nsISupports *aCommandRefCon)
+                                                    nsICommandParams *aParams,
+                                                    nsISupports *aCommandRefCon)
 {
   bool canSwitchTextDirection = true;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canSwitchTextDirection);
   return aParams->SetBooleanValue(STATE_ENABLED, canSwitchTextDirection);
 }
 
 NS_IMETHODIMP
-nsDeleteCommand::IsCommandEnabled(const char* aCommandName,
-                                  nsISupports* aCommandRefCon,
-                                  bool* outCmdEnabled)
+nsDeleteCommand::IsCommandEnabled(const char *aCommandName,
+                                  nsISupports *aCommandRefCon,
+                                  bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   *outCmdEnabled = false;
 
   NS_ENSURE_TRUE(editor, NS_OK);
 
   // We can generally delete whenever the selection is editable.  However,
@@ -558,20 +537,19 @@ nsDeleteCommand::IsCommandEnabled(const 
   if (!nsCRT::strcmp("cmd_delete", aCommandName) && *outCmdEnabled) {
     rv = editor->CanCut(outCmdEnabled);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
-nsDeleteCommand::DoCommand(const char* aCommandName,
-                           nsISupports* aCommandRefCon)
+nsDeleteCommand::DoCommand(const char *aCommandName,
+                           nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
 
   nsIEditor::EDirection deleteDir = nsIEditor::eNone;
 
   if (!nsCRT::strcmp("cmd_delete", aCommandName)) {
     // Really this should probably be eNone, but it only makes a difference if
@@ -592,36 +570,36 @@ nsDeleteCommand::DoCommand(const char* a
     deleteDir = nsIEditor::eToEndOfLine;
   } else {
     MOZ_CRASH("Unrecognized nsDeleteCommand");
   }
 
   return editor->DeleteSelection(deleteDir, nsIEditor::eStrip);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsDeleteCommand::DoCommandParams(const char *aCommandName,
                                  nsICommandParams *aParams,
                                  nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsDeleteCommand::GetCommandStateParams(const char *aCommandName,
                                        nsICommandParams *aParams,
                                        nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
 NS_IMETHODIMP
-nsSelectAllCommand::IsCommandEnabled(const char * aCommandName,
+nsSelectAllCommand::IsCommandEnabled(const char *aCommandName,
                                      nsISupports *aCommandRefCon,
                                      bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
 
   nsresult rv = NS_OK;
   // You can always select all, unless the selection is editable,
   // and the editable region is empty!
@@ -634,49 +612,47 @@ nsSelectAllCommand::IsCommandEnabled(con
     rv = editor->GetDocumentIsEmpty(&docIsEmpty);
     NS_ENSURE_SUCCESS(rv, rv);
     *outCmdEnabled = !docIsEmpty;
   }
 
   return rv;
 }
 
-
 NS_IMETHODIMP
 nsSelectAllCommand::DoCommand(const char *aCommandName,
                               nsISupports *aCommandRefCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->SelectAll();
-    
+
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSelectAllCommand::DoCommandParams(const char *aCommandName,
                                     nsICommandParams *aParams,
                                     nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSelectAllCommand::GetCommandStateParams(const char *aCommandName,
                                           nsICommandParams *aParams,
                                           nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
-
 NS_IMETHODIMP
-nsSelectionMoveCommands::IsCommandEnabled(const char * aCommandName,
+nsSelectionMoveCommands::IsCommandEnabled(const char *aCommandName,
                                           nsISupports *aCommandRefCon,
                                           bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
   if (editor)
     return editor->GetIsSelectionEditable(outCmdEnabled);
 
@@ -760,91 +736,89 @@ nsSelectionMoveCommands::DoCommand(const
   nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
   if (doc) {
     // Most of the commands below (possibly all of them) need layout to
     // be up to date.
     doc->FlushPendingNotifications(Flush_Layout);
   }
 
   nsCOMPtr<nsISelectionController> selCont;
-  nsresult rv = editor->GetSelectionController(getter_AddRefs(selCont)); 
+  nsresult rv = editor->GetSelectionController(getter_AddRefs(selCont));
   NS_ENSURE_SUCCESS(rv, rv);
   NS_ENSURE_TRUE(selCont, NS_ERROR_FAILURE);
 
   // scroll commands
   for (size_t i = 0; i < mozilla::ArrayLength(scrollCommands); i++) {
-    const ScrollCommand& cmd = scrollCommands[i];
+    const ScrollCommand &cmd = scrollCommands[i];
     if (!nsCRT::strcmp(aCommandName, cmd.reverseScroll)) {
       return (selCont->*(cmd.scroll))(false);
     } else if (!nsCRT::strcmp(aCommandName, cmd.forwardScroll)) {
       return (selCont->*(cmd.scroll))(true);
     }
   }
 
   // caret movement/selection commands
   for (size_t i = 0; i < mozilla::ArrayLength(moveCommands); i++) {
-    const MoveCommand& cmd = moveCommands[i];
+    const MoveCommand &cmd = moveCommands[i];
     if (!nsCRT::strcmp(aCommandName, cmd.reverseMove)) {
       return (selCont->*(cmd.move))(false, false);
     } else if (!nsCRT::strcmp(aCommandName, cmd.forwardMove)) {
       return (selCont->*(cmd.move))(true, false);
     } else if (!nsCRT::strcmp(aCommandName, cmd.reverseSelect)) {
       return (selCont->*(cmd.move))(false, true);
     } else if (!nsCRT::strcmp(aCommandName, cmd.forwardSelect)) {
       return (selCont->*(cmd.move))(true, true);
     }
   }
 
   // physical-direction movement/selection
   for (size_t i = 0; i < mozilla::ArrayLength(physicalCommands); i++) {
-    const PhysicalCommand& cmd = physicalCommands[i];
+    const PhysicalCommand &cmd = physicalCommands[i];
     if (!nsCRT::strcmp(aCommandName, cmd.move)) {
       return selCont->PhysicalMove(cmd.direction, cmd.amount, false);
     } else if (!nsCRT::strcmp(aCommandName, cmd.select)) {
       return selCont->PhysicalMove(cmd.direction, cmd.amount, true);
     }
   }
 
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSelectionMoveCommands::DoCommandParams(const char *aCommandName,
                                          nsICommandParams *aParams,
                                          nsISupports *aCommandRefCon)
 {
   return DoCommand(aCommandName, aCommandRefCon);
 }
 
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsSelectionMoveCommands::GetCommandStateParams(const char *aCommandName,
                                                nsICommandParams *aParams,
                                                nsISupports *aCommandRefCon)
 {
   bool canUndo;
   IsCommandEnabled(aCommandName, aCommandRefCon, &canUndo);
-  return aParams->SetBooleanValue(STATE_ENABLED,canUndo);
+  return aParams->SetBooleanValue(STATE_ENABLED, canUndo);
 }
 
-
 NS_IMETHODIMP
-nsInsertPlaintextCommand::IsCommandEnabled(const char * aCommandName,
-                                           nsISupports *refCon, 
+nsInsertPlaintextCommand::IsCommandEnabled(const char *aCommandName,
+                                           nsISupports *refCon,
                                            bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
   if (editor)
     return editor->GetIsSelectionEditable(outCmdEnabled);
 
   *outCmdEnabled = false;
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-
 NS_IMETHODIMP
 nsInsertPlaintextCommand::DoCommand(const char *aCommandName,
                                     nsISupports *refCon)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
@@ -875,69 +849,65 @@ nsInsertPlaintextCommand::GetCommandStat
 {
   NS_ENSURE_ARG_POINTER(aParams);
 
   bool outCmdEnabled = false;
   IsCommandEnabled(aCommandName, refCon, &outCmdEnabled);
   return aParams->SetBooleanValue(STATE_ENABLED, outCmdEnabled);
 }
 
-
 NS_IMETHODIMP
-nsPasteQuotationCommand::IsCommandEnabled(const char * aCommandName,
+nsPasteQuotationCommand::IsCommandEnabled(const char *aCommandName,
                                           nsISupports *refCon,
                                           bool *outCmdEnabled)
 {
   NS_ENSURE_ARG_POINTER(outCmdEnabled);
 
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
-  nsCOMPtr<nsIEditorMailSupport>  mailEditor = do_QueryInterface(refCon);
+  nsCOMPtr<nsIEditorMailSupport> mailEditor = do_QueryInterface(refCon);
   if (editor && mailEditor) {
     uint32_t flags;
     editor->GetFlags(&flags);
     if (!(flags & nsIPlaintextEditor::eEditorSingleLineMask))
       return editor->CanPaste(nsIClipboard::kGlobalClipboard, outCmdEnabled);
   }
 
   *outCmdEnabled = false;
   return NS_OK;
 }
 
-
 NS_IMETHODIMP
 nsPasteQuotationCommand::DoCommand(const char *aCommandName,
                                    nsISupports *refCon)
 {
-  nsCOMPtr<nsIEditorMailSupport>  mailEditor = do_QueryInterface(refCon);
+  nsCOMPtr<nsIEditorMailSupport> mailEditor = do_QueryInterface(refCon);
   if (mailEditor)
     return mailEditor->PasteAsQuotation(nsIClipboard::kGlobalClipboard);
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsPasteQuotationCommand::DoCommandParams(const char *aCommandName,
                                          nsICommandParams *aParams,
                                          nsISupports *refCon)
 {
-  nsCOMPtr<nsIEditorMailSupport>  mailEditor = do_QueryInterface(refCon);
+  nsCOMPtr<nsIEditorMailSupport> mailEditor = do_QueryInterface(refCon);
   if (mailEditor)
     return mailEditor->PasteAsQuotation(nsIClipboard::kGlobalClipboard);
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsPasteQuotationCommand::GetCommandStateParams(const char *aCommandName,
                                                nsICommandParams *aParams,
                                                nsISupports *refCon)
 {
   nsCOMPtr<nsIEditor> editor = do_QueryInterface(refCon);
-  if (editor)
-  {
+  if (editor) {
     bool enabled = false;
     editor->CanPaste(nsIClipboard::kGlobalClipboard, &enabled);
     aParams->SetBooleanValue(STATE_ENABLED, enabled);
   }
- 
+
   return NS_OK;
 }
-