1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-19 15:11:23 +01:00

Replace virtual with override wherever possible; eliminate needless virtual...

... for functions in final classes.

override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.

There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
This commit is contained in:
Paul Licameli
2016-02-24 01:06:47 -05:00
parent 74121c1494
commit 990080ae7d
169 changed files with 1652 additions and 1639 deletions

View File

@@ -46,7 +46,7 @@ public:
// Called when the value in the window must be validated.
// This function can pop up an error message.
virtual bool Validate(wxWindow * parent);
bool Validate(wxWindow * parent) override;
protected:
NumValidatorBase(int style)
@@ -182,7 +182,7 @@ public:
SetMax(max);
}
virtual bool TransferToWindow()
bool TransferToWindow() override
{
if ( m_value )
{
@@ -196,7 +196,7 @@ public:
return true;
}
virtual bool TransferFromWindow()
bool TransferFromWindow() override
{
if ( m_value )
{
@@ -233,7 +233,7 @@ protected:
// Implement NumValidatorBase virtual method which is the same for
// both integer and floating point numbers.
virtual wxString NormalizeString(const wxString& s) const
wxString NormalizeString(const wxString& s) const override
{
LongestValueType value;
return BaseValidator::FromString(s, &value) ? NormalizeValue(value)
@@ -314,8 +314,8 @@ protected:
}
// Implement NumValidatorBase pure virtual method.
virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const;
virtual bool DoValidateNumber(wxString * errMsg) const;
bool IsCharOk(const wxString& val, int pos, wxChar ch) const override;
bool DoValidateNumber(wxString * errMsg) const override;
private:
// Minimal and maximal values accepted (inclusive).
@@ -348,7 +348,7 @@ public:
this->DoSetMax(std::numeric_limits<ValueType>::max());
}
virtual wxObject *Clone() const { return new IntegerValidator(*this); }
wxObject *Clone() const override { return new IntegerValidator(*this); }
private:
DECLARE_NO_ASSIGN_CLASS(IntegerValidator);
@@ -410,8 +410,8 @@ protected:
}
// Implement NumValidatorBase pure virtual method.
virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const;
virtual bool DoValidateNumber(wxString * errMsg) const;
bool IsCharOk(const wxString& val, int pos, wxChar ch) const override;
bool DoValidateNumber(wxString * errMsg) const override;
//Checks that it doesn't have too many decimal digits.
bool ValidatePrecision(const wxString& s) const;
@@ -457,7 +457,7 @@ public:
this->SetPrecision(precision);
}
virtual wxObject *Clone() const
wxObject *Clone() const override
{
return new FloatingPointValidator(*this);
}