Bug 1319401 - Use C++11's override and remove virtual where applicable in editor/. r=masayuki
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Tue, 22 Nov 2016 14:14:48 +0200
changeset 323965 7e495dade309c58ede71cf539070215870019f97
parent 323964 8c616addd4541ac62d2f06b657b4097c34a3ec87
child 323966 6b5f8f8cd9a55f9757cce56837a14da2f9cf68a6
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmasayuki
bugs1319401
milestone53.0a1
Bug 1319401 - Use C++11's override and remove virtual where applicable in editor/. r=masayuki MozReview-Commit-ID: CdlsJOlAW9e
editor/txmgr/tests/TestTXMgr.cpp
--- a/editor/txmgr/tests/TestTXMgr.cpp
+++ b/editor/txmgr/tests/TestTXMgr.cpp
@@ -283,78 +283,78 @@ protected:
   int32_t mFlags;
 
 public:
 
   explicit SimpleTransaction(int32_t aFlags=NONE_FLAG)
     : mVal(++sConstructorCount), mFlags(aFlags)
   {}
 
-  virtual ~SimpleTransaction() = default;
+  ~SimpleTransaction() override = default;
 
-  NS_IMETHOD DoTransaction()
+  NS_IMETHOD DoTransaction() override
   {
     //
     // Make sure DoTransaction() is called in the order we expect!
     // Notice that we don't check to see if we go past the end of the array.
     // This is done on purpose since we want to crash if the order array is out
     // of date.
     //
     if (sDoOrderArr) {
       EXPECT_EQ(mVal, sDoOrderArr[sDoCount]);
     }
 
     ++sDoCount;
 
     return (mFlags & THROWS_DO_ERROR_FLAG) ? NS_ERROR_FAILURE : NS_OK;
   }
 
-  NS_IMETHOD UndoTransaction()
+  NS_IMETHOD UndoTransaction() override
   {
     //
     // Make sure UndoTransaction() is called in the order we expect!
     // Notice that we don't check to see if we go past the end of the array.
     // This is done on purpose since we want to crash if the order array is out
     // of date.
     //
     if (sUndoOrderArr) {
       EXPECT_EQ(mVal, sUndoOrderArr[sUndoCount]);
     }
 
     ++sUndoCount;
 
     return (mFlags & THROWS_UNDO_ERROR_FLAG) ? NS_ERROR_FAILURE : NS_OK;
   }
 
-  NS_IMETHOD RedoTransaction()
+  NS_IMETHOD RedoTransaction() override
   {
     //
     // Make sure RedoTransaction() is called in the order we expect!
     // Notice that we don't check to see if we go past the end of the array.
     // This is done on purpose since we want to crash if the order array is out
     // of date.
     //
     if (sRedoOrderArr) {
       EXPECT_EQ(mVal, sRedoOrderArr[sRedoCount]);
     }
 
     ++sRedoCount;
 
     return (mFlags & THROWS_REDO_ERROR_FLAG) ? NS_ERROR_FAILURE : NS_OK;
   }
 
-  NS_IMETHOD GetIsTransient(bool *aIsTransient)
+  NS_IMETHOD GetIsTransient(bool *aIsTransient) override
   {
     if (aIsTransient) {
       *aIsTransient = (mFlags & TRANSIENT_FLAG) ? true : false;
     }
     return NS_OK;
   }
 
-  NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge)
+  NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge) override
   {
     if (aDidMerge) {
       *aDidMerge = (mFlags & MERGE_FLAG) ? true : false;
     }
     return NS_OK;
   }
 };
 
@@ -396,19 +396,19 @@ public:
     mNumber             = 1;
     mFlags              = aFlags & (~ALL_ERROR_FLAGS);
     mErrorFlags         = aFlags & ALL_ERROR_FLAGS;
     mTXMgr              = aTXMgr;
     mMaxLevel           = aMaxLevel;
     mNumChildrenPerNode = aNumChildrenPerNode;
   }
 
-  virtual ~AggregateTransaction() = default;
+  ~AggregateTransaction() override = default;
 
-  NS_IMETHOD DoTransaction()
+  NS_IMETHOD DoTransaction() override
   {
     if (mLevel >= mMaxLevel) {
       // Only leaf nodes can throw errors!
       mFlags |= mErrorFlags;
     }
 
     nsresult rv = SimpleTransaction::DoTransaction();
     if (NS_FAILED(rv)) {
@@ -470,17 +470,17 @@ class TestTransactionFactory
 public:
   virtual TestTransaction *create(nsITransactionManager *txmgr, int32_t flags) = 0;
 };
 
 class SimpleTransactionFactory : public TestTransactionFactory
 {
 public:
 
-  TestTransaction *create(nsITransactionManager *txmgr, int32_t flags)
+  TestTransaction *create(nsITransactionManager *txmgr, int32_t flags) override
   {
     return (TestTransaction *)new SimpleTransaction(flags);
   }
 };
 
 class AggregateTransactionFactory : public TestTransactionFactory
 {
 private:
@@ -493,17 +493,17 @@ public:
 
   AggregateTransactionFactory(int32_t aMaxLevel, int32_t aNumChildrenPerNode,
                               int32_t aFixedFlags=NONE_FLAG)
       : mMaxLevel(aMaxLevel), mNumChildrenPerNode(aNumChildrenPerNode),
         mFixedFlags(aFixedFlags)
   {
   }
 
-  virtual TestTransaction *create(nsITransactionManager *txmgr, int32_t flags)
+  TestTransaction *create(nsITransactionManager *txmgr, int32_t flags) override
   {
     return (TestTransaction *)new AggregateTransaction(txmgr, mMaxLevel,
                                                        mNumChildrenPerNode,
                                                        flags | mFixedFlags);
   }
 };
 
 void