Bug 1319401 - Use C++11's override and remove virtual where applicable in editor/.
MozReview-Commit-ID: CdlsJOlAW9e
--- 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