Bug 1061050 - Fix more bad implicit constructors in editor; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 31 Aug 2014 23:49:37 -0400
changeset 202860 d4435430598f14340a30c8f80d7187022aef8cb2
parent 202859 971f1ff8f6bac45843f7174121e4936f6e104c5c
child 202861 2572b784a8bbd0119cd0e97119499d6654c3f0ba
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs1061050
milestone34.0a1
Bug 1061050 - Fix more bad implicit constructors in editor; r=roc
editor/composer/nsComposerCommands.h
editor/composer/nsEditorSpellCheck.cpp
editor/txmgr/nsTransactionItem.h
--- a/editor/composer/nsComposerCommands.h
+++ b/editor/composer/nsComposerCommands.h
@@ -50,17 +50,17 @@ class _cmd : public nsBaseComposerComman
 public:                                                 \
   NS_DECL_NSICONTROLLERCOMMAND                          \
 };
 
 // virtual base class for commands that need to save and update Boolean state (like styles etc)
 class nsBaseStateUpdatingCommand : public nsBaseComposerCommand
 {
 public:
-  nsBaseStateUpdatingCommand(nsIAtom* aTagName);
+  explicit nsBaseStateUpdatingCommand(nsIAtom* aTagName);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSICONTROLLERCOMMAND
 
 protected:
   virtual ~nsBaseStateUpdatingCommand();
 
@@ -75,17 +75,17 @@ protected:
 };
 
 
 // Shared class for the various style updating commands like bold, italics etc.
 // Suitable for commands whose state is either 'on' or 'off'.
 class nsStyleUpdatingCommand : public nsBaseStateUpdatingCommand
 {
 public:
-  nsStyleUpdatingCommand(nsIAtom* aTagName);
+  explicit nsStyleUpdatingCommand(nsIAtom* aTagName);
            
 protected:
 
   // get the current state (on or off) for this style or block format
   virtual nsresult  GetCurrentState(nsIEditor* aEditor, nsICommandParams* aParams);
   
   // add/remove the style
   virtual nsresult  ToggleState(nsIEditor* aEditor);
@@ -106,31 +106,31 @@ protected:
 
   nsIAtom* mTagName;
 };
 
 
 class nsListCommand : public nsBaseStateUpdatingCommand
 {
 public:
-  nsListCommand(nsIAtom* aTagName);
+  explicit nsListCommand(nsIAtom* aTagName);
 
 protected:
 
   // get the current state (on or off) for this style or block format
   virtual nsresult  GetCurrentState(nsIEditor* aEditor, nsICommandParams* aParams);
   
   // add/remove the style
   virtual nsresult  ToggleState(nsIEditor* aEditor);
 };
 
 class nsListItemCommand : public nsBaseStateUpdatingCommand
 {
 public:
-  nsListItemCommand(nsIAtom* aTagName);
+  explicit nsListItemCommand(nsIAtom* aTagName);
 
 protected:
 
   // get the current state (on or off) for this style or block format
   virtual nsresult  GetCurrentState(nsIEditor* aEditor, nsICommandParams* aParams);
   
   // add/remove the style
   virtual nsresult  ToggleState(nsIEditor* aEditor);
--- a/editor/composer/nsEditorSpellCheck.cpp
+++ b/editor/composer/nsEditorSpellCheck.cpp
@@ -45,17 +45,17 @@
 #include "nsXULAppAPI.h"                // for XRE_GetProcessType
 
 using namespace mozilla;
 
 class UpdateDictionnaryHolder {
   private:
     nsEditorSpellCheck* mSpellCheck;
   public:
-    UpdateDictionnaryHolder(nsEditorSpellCheck* esc): mSpellCheck(esc) {
+    explicit UpdateDictionnaryHolder(nsEditorSpellCheck* esc): mSpellCheck(esc) {
       if (mSpellCheck) {
         mSpellCheck->BeginUpdateDictionary();
       }
     }
     ~UpdateDictionnaryHolder() {
       if (mSpellCheck) {
         mSpellCheck->EndUpdateDictionary();
       }
--- a/editor/txmgr/nsTransactionItem.h
+++ b/editor/txmgr/nsTransactionItem.h
@@ -20,17 +20,17 @@ class nsTransactionItem MOZ_FINAL
 {
   nsCOMArray<nsISupports>  mData;
   nsCOMPtr<nsITransaction> mTransaction;
   nsTransactionStack      *mUndoStack;
   nsTransactionStack      *mRedoStack;
 
 public:
 
-  nsTransactionItem(nsITransaction *aTransaction);
+  explicit nsTransactionItem(nsITransaction *aTransaction);
   NS_METHOD_(MozExternalRefCountType) AddRef();
   NS_METHOD_(MozExternalRefCountType) Release();
 
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsTransactionItem)
 
   virtual nsresult AddChild(nsTransactionItem *aTransactionItem);
   already_AddRefed<nsITransaction> GetTransaction();
   virtual nsresult GetIsBatch(bool *aIsBatch);