Use default ctor's and dtor's instead of functions with empty bodies

This commit is contained in:
Artur Wieczorek 2022-12-30 14:09:04 +02:00
parent 357f611a48
commit 6863b0a92d
13 changed files with 25 additions and 112 deletions

View file

@ -75,9 +75,7 @@ public:
{
}
virtual ~wxColourPropertyValue()
{
}
virtual ~wxColourPropertyValue() = default;
wxColourPropertyValue( const wxColourPropertyValue& v )
: wxObject()
@ -241,7 +239,7 @@ public:
wxColourProperty( const wxString& label = wxPG_LABEL,
const wxString& name = wxPG_LABEL,
const wxColour& value = *wxWHITE );
virtual ~wxColourProperty();
virtual ~wxColourProperty() = default;
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const override;
virtual wxColour GetColour( int index ) const override;
@ -263,7 +261,7 @@ class WXDLLIMPEXP_PROPGRID wxCursorProperty : public wxEnumProperty
wxCursorProperty( const wxString& label= wxPG_LABEL,
const wxString& name= wxPG_LABEL,
int value = 0 );
virtual ~wxCursorProperty();
virtual ~wxCursorProperty() = default;
virtual wxString ValueToString(wxVariant& value, int argFlags = 0) const override;
virtual wxSize OnMeasureImage( int item ) const override;
@ -288,7 +286,7 @@ public:
wxImageFileProperty( const wxString& label= wxPG_LABEL,
const wxString& name = wxPG_LABEL,
const wxString& value = wxString());
virtual ~wxImageFileProperty();
virtual ~wxImageFileProperty() = default;
virtual void OnSetValue() override;
@ -332,7 +330,7 @@ public:
const wxString& name = wxPG_LABEL,
const wxArrayString& value = wxArrayString() );
virtual ~wxMultiChoiceProperty();
virtual ~wxMultiChoiceProperty() = default;
virtual void OnSetValue() override;
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const override;
@ -382,7 +380,7 @@ public:
wxDateProperty( const wxString& label = wxPG_LABEL,
const wxString& name = wxPG_LABEL,
const wxDateTime& value = wxDateTime() );
virtual ~wxDateProperty();
virtual ~wxDateProperty() = default;
virtual void OnSetValue() override;
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const override;

View file

@ -73,7 +73,7 @@ public:
}
// Destructor.
virtual ~wxPGEditor();
virtual ~wxPGEditor() = default;
// Returns pointer to the name of the editor. For example,
// wxPGEditor_TextCtrl has name "TextCtrl". If you don't need to access

View file

@ -51,7 +51,7 @@ class WXDLLIMPEXP_PROPGRID wxPropertyGridPage : public wxEvtHandler,
public:
wxPropertyGridPage();
virtual ~wxPropertyGridPage();
virtual ~wxPropertyGridPage() = default;
// Deletes all properties on page.
virtual void Clear() override;

View file

@ -652,7 +652,7 @@ class WXDLLIMPEXP_PROPGRID wxPGChoicesData : public wxObjectRefData
friend class wxPGChoices;
public:
// Constructor sets m_refCount to 1.
wxPGChoicesData();
wxPGChoicesData() = default;
void CopyDataFrom( wxPGChoicesData* data );
@ -2085,7 +2085,7 @@ public:
// Constructor.
wxPGRootProperty( const wxString& name = wxS("<Root>") );
virtual ~wxPGRootProperty();
virtual ~wxPGRootProperty() = default;
virtual bool StringToValue( wxVariant&, const wxString&, int ) const override
{
@ -2109,7 +2109,7 @@ public:
wxPropertyCategory( const wxString& label,
const wxString& name = wxPG_LABEL );
~wxPropertyCategory();
virtual ~wxPropertyCategory() = default;
int GetTextExtent( const wxWindow* wnd, const wxFont& font ) const;

View file

@ -657,7 +657,7 @@ class WXDLLIMPEXP_PROPGRID wxPGStringTokenizer
{
public:
wxPGStringTokenizer( const wxString& str, wxChar delimiter );
~wxPGStringTokenizer();
~wxPGStringTokenizer() = default;
bool HasMoreTokens(); // not const so we can do some stuff in it
wxString GetNextToken();

View file

@ -35,9 +35,7 @@ public:
{
}
~wxPropertyGridHitTestResult()
{
}
~wxPropertyGridHitTestResult() = default;
// Returns column hit. -1 for margin.
int GetColumn() const { return m_column; }
@ -165,9 +163,7 @@ wxPG_ITERATE_DEFAULT = wxPG_ITERATE_NORMAL
class WXDLLIMPEXP_PROPGRID wxPropertyGridIteratorBase
{
public:
wxPropertyGridIteratorBase()
{
}
wxPropertyGridIteratorBase() = default;
void Assign( const wxPropertyGridIteratorBase& it );
@ -236,9 +232,8 @@ public:
{
Assign(it);
}
~wxPGIterator()
{
}
~wxPGIterator() = default;
wxPGIterator& operator=(const wxPGIterator& it)
{
if ( this != &it )

View file

@ -158,7 +158,7 @@ class WXDLLIMPEXP_PROPGRID wxNumericProperty : public wxPGProperty
{
wxDECLARE_ABSTRACT_CLASS(wxNumericProperty);
public:
virtual ~wxNumericProperty();
virtual ~wxNumericProperty() = default;
virtual bool DoSetAttribute(const wxString& name, wxVariant& value) override;
@ -396,7 +396,7 @@ public:
int value = 0 );
#endif
virtual ~wxEnumProperty();
virtual ~wxEnumProperty() = default;
size_t GetItemCount() const { return m_choices.GetCount(); }
@ -493,7 +493,7 @@ public:
wxPGChoices* choicesCache,
const wxString& value );
virtual ~wxEditEnumProperty();
virtual ~wxEditEnumProperty() = default;
void OnSetValue() override;
bool StringToValue(wxVariant& variant,
@ -535,7 +535,7 @@ public:
const wxArrayString& labels = wxArrayString(),
const wxArrayInt& values = wxArrayInt(),
int value = 0 );
virtual ~wxFlagsProperty ();
virtual ~wxFlagsProperty () = default;
virtual void OnSetValue() override;
virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const override;
@ -578,7 +578,7 @@ class WXDLLIMPEXP_PROPGRID wxEditorDialogProperty : public wxPGProperty
wxDECLARE_ABSTRACT_CLASS(wxEditorDialogProperty);
public:
virtual ~wxEditorDialogProperty();
virtual ~wxEditorDialogProperty() = default;
virtual wxPGEditorDialogAdapter* GetEditorDialog() const override;
virtual bool DoSetAttribute(const wxString& name, wxVariant& value) override;

View file

@ -1592,10 +1592,6 @@ wxColourProperty::wxColourProperty( const wxString& label,
m_flags |= wxPG_PROP_TRANSLATE_CUSTOM;
}
wxColourProperty::~wxColourProperty()
{
}
void wxColourProperty::Init( wxColour colour )
{
if ( !colour.IsOk() )
@ -1718,10 +1714,6 @@ wxCursorProperty::wxCursorProperty( const wxString& label, const wxString& name,
m_flags |= wxPG_PROP_STATIC_CHOICES; // Cursor selection cannot be changed.
}
wxCursorProperty::~wxCursorProperty()
{
}
wxString wxCursorProperty::ValueToString(wxVariant& value, int argFlags) const
{
return wxGetTranslation(wxEnumProperty::ValueToString(value, argFlags),
@ -1834,10 +1826,6 @@ wxImageFileProperty::wxImageFileProperty( const wxString& label, const wxString&
LoadImageFromFile();
}
wxImageFileProperty::~wxImageFileProperty()
{
}
void wxImageFileProperty::OnSetValue()
{
wxFileProperty::OnSetValue();
@ -1954,10 +1942,6 @@ wxMultiChoiceProperty::wxMultiChoiceProperty( const wxString& label,
SetValue(value);
}
wxMultiChoiceProperty::~wxMultiChoiceProperty()
{
}
void wxMultiChoiceProperty::OnSetValue()
{
m_display = GenerateValueAsString(m_value);
@ -2143,10 +2127,6 @@ wxDateProperty::wxDateProperty( const wxString& label,
SetValue( value );
}
wxDateProperty::~wxDateProperty()
{
}
void wxDateProperty::OnSetValue()
{
//

View file

@ -118,11 +118,6 @@
wxIMPLEMENT_ABSTRACT_CLASS(wxPGEditor, wxObject);
wxPGEditor::~wxPGEditor()
{
}
wxString wxPGEditor::GetName() const
{
return GetClassInfo()->GetClassName();
@ -1487,8 +1482,7 @@ public:
wxControl::SetBackgroundStyle( wxBG_STYLE_PAINT );
}
virtual ~wxSimpleCheckBox();
virtual ~wxSimpleCheckBox() = default;
void SetBoxHeight(int height)
{
@ -1537,10 +1531,6 @@ wxBEGIN_EVENT_TABLE(wxSimpleCheckBox, wxControl)
EVT_COMMAND(wxID_ANY, wxEVT_CB_LEFT_CLICK_ACTIVATE, wxSimpleCheckBox::OnLeftClickActivate)
wxEND_EVENT_TABLE()
wxSimpleCheckBox::~wxSimpleCheckBox()
{
}
void wxSimpleCheckBox::OnPaint( wxPaintEvent& WXUNUSED(event) )
{
wxAutoBufferedPaintDC dc(this);

View file

@ -339,10 +339,6 @@ wxPropertyGridPage::wxPropertyGridPage()
m_pState = this; // wxPropertyGridInterface to point to State
}
wxPropertyGridPage::~wxPropertyGridPage()
{
}
void wxPropertyGridPage::Clear()
{
GetStatePtr()->DoClear();

View file

@ -2769,12 +2769,6 @@ wxPGRootProperty::wxPGRootProperty( const wxString& name )
m_depth = 0;
}
wxPGRootProperty::~wxPGRootProperty()
{
}
// -----------------------------------------------------------------------
// wxPropertyCategory
// -----------------------------------------------------------------------
@ -2802,12 +2796,6 @@ wxPropertyCategory::wxPropertyCategory( const wxString &label, const wxString& n
Init();
}
wxPropertyCategory::~wxPropertyCategory()
{
}
wxString wxPropertyCategory::ValueToString( wxVariant& WXUNUSED(value),
int WXUNUSED(argFlags) ) const
{

View file

@ -3862,9 +3862,7 @@ public:
{
}
virtual ~wxPropertyGridEditorEventForwarder()
{
}
virtual ~wxPropertyGridEditorEventForwarder() = default;
private:
bool ProcessEvent( wxEvent& event ) override
@ -6141,10 +6139,6 @@ wxPGStringTokenizer::wxPGStringTokenizer( const wxString& str, wxChar delimiter
{
}
wxPGStringTokenizer::~wxPGStringTokenizer()
{
}
bool wxPGStringTokenizer::HasMoreTokens()
{
const wxString& str = m_str;
@ -6220,10 +6214,6 @@ wxPGChoiceEntry::wxPGChoiceEntry()
// wxPGChoicesData
// -----------------------------------------------------------------------
wxPGChoicesData::wxPGChoicesData()
{
}
wxPGChoicesData::~wxPGChoicesData()
{
Clear();

View file

@ -199,10 +199,6 @@ wxNumericProperty::wxNumericProperty(const wxString& label, const wxString& name
{
}
wxNumericProperty::~wxNumericProperty()
{
}
bool wxNumericProperty::DoSetAttribute(const wxString& name, wxVariant& value)
{
if ( name == wxPG_ATTR_MIN )
@ -1244,10 +1240,6 @@ int wxEnumProperty::GetIndexForValue( int value ) const
return -1;
}
wxEnumProperty::~wxEnumProperty ()
{
}
void wxEnumProperty::OnSetValue()
{
const wxString valType(m_value.GetType());
@ -1425,10 +1417,6 @@ wxEditEnumProperty::wxEditEnumProperty( const wxString& label, const wxString& n
SetValue( value );
}
wxEditEnumProperty::~wxEditEnumProperty()
{
}
void wxEditEnumProperty::OnSetValue()
{
const wxString valType(m_value.GetType());
@ -1625,10 +1613,6 @@ wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name,
}
}
wxFlagsProperty::~wxFlagsProperty()
{
}
void wxFlagsProperty::OnSetValue()
{
if ( !m_choices.IsOk() || !GetItemCount() )
@ -1905,13 +1889,9 @@ bool wxDirProperty::DoSetAttribute(const wxString& name, wxVariant& value)
class WXDLLIMPEXP_PROPGRID wxPGDialogAdapter : public wxPGEditorDialogAdapter
{
public:
wxPGDialogAdapter() : wxPGEditorDialogAdapter()
{
}
wxPGDialogAdapter() = default;
virtual ~wxPGDialogAdapter()
{
}
virtual ~wxPGDialogAdapter() = default;
virtual bool DoShowDialog(wxPropertyGrid* pg, wxPGProperty* prop) override
{
@ -1941,10 +1921,6 @@ wxEditorDialogProperty::wxEditorDialogProperty(const wxString& label, const wxSt
{
}
wxEditorDialogProperty::~wxEditorDialogProperty()
{
}
wxPGEditorDialogAdapter* wxEditorDialogProperty::GetEditorDialog() const
{
return new wxPGDialogAdapter();