Initialize data members in initialization lists

This commit is contained in:
Artur Wieczorek
2022-05-21 22:01:58 +02:00
parent 950f3ff34f
commit 1c292cfe2c
11 changed files with 57 additions and 64 deletions

View File

@@ -71,8 +71,8 @@ public:
wxColourPropertyValue() wxColourPropertyValue()
: wxObject() : wxObject()
, m_type(0)
{ {
m_type = 0;
} }
virtual ~wxColourPropertyValue() virtual ~wxColourPropertyValue()
@@ -81,9 +81,9 @@ public:
wxColourPropertyValue( const wxColourPropertyValue& v ) wxColourPropertyValue( const wxColourPropertyValue& v )
: wxObject() : wxObject()
, m_type(v.m_type)
, m_colour(v.m_colour) , m_colour(v.m_colour)
{ {
m_type = v.m_type;
} }
void Init( wxUint32 type, const wxColour& colour ) void Init( wxUint32 type, const wxColour& colour )
@@ -94,15 +94,15 @@ public:
wxColourPropertyValue( const wxColour& colour ) wxColourPropertyValue( const wxColour& colour )
: wxObject() : wxObject()
, m_type(wxPG_COLOUR_CUSTOM)
, m_colour(colour) , m_colour(colour)
{ {
m_type = wxPG_COLOUR_CUSTOM;
} }
wxColourPropertyValue( wxUint32 type ) wxColourPropertyValue( wxUint32 type )
: wxObject() : wxObject()
, m_type(type)
{ {
m_type = type;
} }
wxColourPropertyValue( wxUint32 type, const wxColour& colour ) wxColourPropertyValue( wxUint32 type, const wxColour& colour )

View File

@@ -67,8 +67,8 @@ public:
// Constructor. // Constructor.
wxPGEditor() wxPGEditor()
: wxObject() : wxObject()
, m_clientData(NULL)
{ {
m_clientData = NULL;
} }
// Destructor. // Destructor.
@@ -418,8 +418,8 @@ class WXDLLIMPEXP_PROPGRID wxPGEditorDialogAdapter : public wxObject
public: public:
wxPGEditorDialogAdapter() wxPGEditorDialogAdapter()
: wxObject() : wxObject()
, m_clientData(NULL)
{ {
m_clientData = NULL;
} }
virtual ~wxPGEditorDialogAdapter() { } virtual ~wxPGEditorDialogAdapter() { }

View File

@@ -648,12 +648,13 @@ public:
wxPGChoiceEntry(); wxPGChoiceEntry();
wxPGChoiceEntry(const wxPGChoiceEntry& other) wxPGChoiceEntry(const wxPGChoiceEntry& other)
: wxPGCell(other) : wxPGCell(other)
, m_value(other.m_value)
{ {
m_value = other.m_value;
} }
wxPGChoiceEntry( const wxString& label, wxPGChoiceEntry( const wxString& label,
int value = wxPG_INVALID_VALUE ) int value = wxPG_INVALID_VALUE )
: wxPGCell(), m_value(value) : wxPGCell()
, m_value(value)
{ {
SetText(label); SetText(label);
} }

View File

@@ -334,8 +334,8 @@ public:
wxPGCommonValue( const wxString& label, wxPGCellRenderer* renderer ) wxPGCommonValue( const wxString& label, wxPGCellRenderer* renderer )
: m_label(label) : m_label(label)
, m_renderer(renderer)
{ {
m_renderer = renderer;
renderer->IncRef(); renderer->IncRef();
} }
virtual ~wxPGCommonValue() virtual ~wxPGCommonValue()
@@ -408,9 +408,9 @@ class WXDLLIMPEXP_PROPGRID wxPGValidationInfo
friend class wxPropertyGrid; friend class wxPropertyGrid;
public: public:
wxPGValidationInfo() wxPGValidationInfo()
: m_failureBehavior(0)
, m_isFailing(false)
{ {
m_failureBehavior = 0;
m_isFailing = false;
} }
~wxPGValidationInfo() ~wxPGValidationInfo()

View File

@@ -26,11 +26,11 @@ class WXDLLIMPEXP_PROPGRID wxPropertyGridHitTestResult
friend class wxPropertyGridPageState; friend class wxPropertyGridPageState;
public: public:
wxPropertyGridHitTestResult() wxPropertyGridHitTestResult()
: m_property(NULL)
, m_column(-1)
, m_splitter(-1)
, m_splitterHitOffset(0)
{ {
m_property = NULL;
m_column = -1;
m_splitter = -1;
m_splitterHitOffset = 0;
} }
~wxPropertyGridHitTestResult() ~wxPropertyGridHitTestResult()

View File

@@ -113,10 +113,9 @@ class wxPGSpinButton : public wxSpinButton
{ {
public: public:
wxPGSpinButton() : wxSpinButton() wxPGSpinButton() : wxSpinButton()
, m_hasCapture(false)
, m_spins(1)
{ {
m_hasCapture = false;
m_spins = 1;
Bind(wxEVT_LEFT_DOWN, &wxPGSpinButton::OnMouseLeftDown, this); Bind(wxEVT_LEFT_DOWN, &wxPGSpinButton::OnMouseLeftDown, this);
Bind(wxEVT_LEFT_UP, &wxPGSpinButton::OnMouseLeftUp, this); Bind(wxEVT_LEFT_UP, &wxPGSpinButton::OnMouseLeftUp, this);
Bind(wxEVT_MOTION, &wxPGSpinButton::OnMouseMove, this); Bind(wxEVT_MOTION, &wxPGSpinButton::OnMouseMove, this);

View File

@@ -492,11 +492,11 @@ public:
wxPGDoubleClickProcessor( wxOwnerDrawnComboBox* combo, wxBoolProperty* property ) wxPGDoubleClickProcessor( wxOwnerDrawnComboBox* combo, wxBoolProperty* property )
: wxEvtHandler() : wxEvtHandler()
, m_timeLastMouseUp(0)
, m_combo(combo)
, m_property(property)
, m_downReceived(false)
{ {
m_timeLastMouseUp = 0;
m_combo = combo;
m_property = property;
m_downReceived = false;
} }
protected: protected:
@@ -575,8 +575,8 @@ public:
wxPGComboBox() wxPGComboBox()
: wxOwnerDrawnComboBox() : wxOwnerDrawnComboBox()
, m_dclickProcessor(NULL)
{ {
m_dclickProcessor = NULL;
} }
~wxPGComboBox() ~wxPGComboBox()
@@ -1482,11 +1482,11 @@ public:
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize ) const wxSize& size = wxDefaultSize )
: wxControl(parent,id,pos,size,wxBORDER_NONE|wxWANTS_CHARS) : wxControl(parent,id,pos,size,wxBORDER_NONE|wxWANTS_CHARS)
, m_state(0)
{ {
// Due to SetOwnFont stuff necessary for GTK+ 1.2, we need to have this // Due to SetOwnFont stuff necessary for GTK+ 1.2, we need to have this
SetFont( parent->GetFont() ); SetFont( parent->GetFont() );
m_state = 0;
SetBoxHeight(12); SetBoxHeight(12);
SetBackgroundStyle( wxBG_STYLE_PAINT ); SetBackgroundStyle( wxBG_STYLE_PAINT );
} }

View File

@@ -333,10 +333,10 @@ wxEND_EVENT_TABLE()
wxPropertyGridPage::wxPropertyGridPage() wxPropertyGridPage::wxPropertyGridPage()
: wxEvtHandler(), wxPropertyGridInterface(), wxPropertyGridPageState() : wxEvtHandler(), wxPropertyGridInterface(), wxPropertyGridPageState()
, m_manager(NULL)
, m_isDefault(false)
{ {
m_pState = this; // wxPropertyGridInterface to point to State m_pState = this; // wxPropertyGridInterface to point to State
m_manager = NULL;
m_isDefault = false;
} }
wxPropertyGridPage::~wxPropertyGridPage() wxPropertyGridPage::~wxPropertyGridPage()
@@ -395,10 +395,10 @@ class wxPGHeaderCtrl : public wxHeaderCtrl
{ {
public: public:
wxPGHeaderCtrl(wxPropertyGridManager* manager, wxWindowID id, const wxPoint& pos, wxPGHeaderCtrl(wxPropertyGridManager* manager, wxWindowID id, const wxPoint& pos,
const wxSize& size, long style) : const wxSize& size, long style)
wxHeaderCtrl(manager, id, pos, size, style) : wxHeaderCtrl(manager, id, pos, size, style)
, m_manager(manager)
{ {
m_manager = manager;
EnsureColumnCount(2); EnsureColumnCount(2);
// Seed titles with defaults // Seed titles with defaults

View File

@@ -354,8 +354,8 @@ wxSize wxPGDefaultRenderer::GetImageSize( const wxPGProperty* property,
wxPGCellData::wxPGCellData() wxPGCellData::wxPGCellData()
: wxObjectRefData() : wxObjectRefData()
, m_hasValidText(false)
{ {
m_hasValidText = false;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------

View File

@@ -166,7 +166,9 @@ wxPGGlobalVarsClass* wxPGGlobalVars = NULL;
wxPGGlobalVarsClass::wxPGGlobalVarsClass() wxPGGlobalVarsClass::wxPGGlobalVarsClass()
// Prepare some shared variants // Prepare some shared variants
: m_vEmptyString(wxString()) : m_fontFamilyChoices(NULL)
, m_defaultRenderer(new wxPGDefaultRenderer())
, m_vEmptyString(wxString())
, m_vZero(0L) , m_vZero(0L)
, m_vMinusOne(-1L) , m_vMinusOne(-1L)
, m_vTrue(true) , m_vTrue(true)
@@ -184,6 +186,10 @@ wxPGGlobalVarsClass::wxPGGlobalVarsClass()
#if wxPG_COMPATIBILITY_1_4 #if wxPG_COMPATIBILITY_1_4
, m_strInlineHelp(wxS("InlineHelp")) , m_strInlineHelp(wxS("InlineHelp"))
#endif #endif
, m_autoGetTranslation(false)
, m_offline(0)
, m_extraStyle(0)
, m_warnings(0)
{ {
wxPGProperty::sm_wxPG_LABEL = new wxString(wxPG_LABEL_STRING); wxPGProperty::sm_wxPG_LABEL = new wxString(wxPG_LABEL_STRING);
@@ -191,18 +197,6 @@ wxPGGlobalVarsClass::wxPGGlobalVarsClass()
m_boolChoices.Add(_("False")); m_boolChoices.Add(_("False"));
/* TRANSLATORS: Name of Boolean true value */ /* TRANSLATORS: Name of Boolean true value */
m_boolChoices.Add(_("True")); m_boolChoices.Add(_("True"));
m_fontFamilyChoices = NULL;
m_defaultRenderer = new wxPGDefaultRenderer();
m_autoGetTranslation = false;
m_offline = 0;
m_extraStyle = 0;
m_warnings = 0;
} }
@@ -6338,8 +6332,8 @@ void wxPropertyGridEvent::Init()
wxPropertyGridEvent::wxPropertyGridEvent(wxEventType commandType, int id) wxPropertyGridEvent::wxPropertyGridEvent(wxEventType commandType, int id)
: wxCommandEvent(commandType,id) : wxCommandEvent(commandType,id)
, m_property(NULL)
{ {
m_property = NULL;
Init(); Init();
} }
@@ -6347,15 +6341,15 @@ wxPropertyGridEvent::wxPropertyGridEvent(wxEventType commandType, int id)
wxPropertyGridEvent::wxPropertyGridEvent(const wxPropertyGridEvent& event) wxPropertyGridEvent::wxPropertyGridEvent(const wxPropertyGridEvent& event)
: wxCommandEvent(event) : wxCommandEvent(event)
, m_property(event.m_property)
, m_pg(event.m_pg)
, m_validationInfo(event.m_validationInfo)
, m_canVeto(event.m_canVeto)
, m_wasVetoed(event.m_wasVetoed)
{ {
m_eventType = event.GetEventType(); m_eventType = event.GetEventType();
m_eventObject = event.m_eventObject; m_eventObject = event.m_eventObject;
m_pg = event.m_pg;
OnPropertyGridSet(); OnPropertyGridSet();
m_property = event.m_property;
m_validationInfo = event.m_validationInfo;
m_canVeto = event.m_canVeto;
m_wasVetoed = event.m_wasVetoed;
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
@@ -6408,9 +6402,9 @@ wxEvent* wxPropertyGridEvent::Clone() const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
wxPropertyGridPopulator::wxPropertyGridPopulator() wxPropertyGridPopulator::wxPropertyGridPopulator()
: m_pg(NULL)
, m_state(NULL)
{ {
m_state = NULL;
m_pg = NULL;
wxPGGlobalVars->m_offline++; wxPGGlobalVars->m_offline++;
} }

View File

@@ -188,27 +188,26 @@ void wxPropertyGridIteratorBase::Next( bool iterateChildren )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
wxPropertyGridPageState::wxPropertyGridPageState() wxPropertyGridPageState::wxPropertyGridPageState()
: m_pPropGrid(NULL)
, m_properties(&m_regularArray)
, m_abcArray(NULL)
, m_currentCategory(NULL)
, m_width(0)
, m_virtualHeight(0)
, m_itemsAdded(false)
, m_anyModified(false)
, m_vhCalcPending(false)
, m_fSplitterX(wxPG_DEFAULT_SPLITTERX)
, m_isSplitterPreSet(false)
, m_dontCenterSplitter(false)
{ {
m_pPropGrid = NULL;
m_regularArray.SetParentState(this); m_regularArray.SetParentState(this);
m_properties = &m_regularArray;
m_abcArray = NULL;
m_currentCategory = NULL;
m_width = 0;
m_virtualHeight = 0;
m_itemsAdded = false;
m_anyModified = false;
m_vhCalcPending = false;
m_colWidths.push_back( wxPG_DEFAULT_SPLITTERX ); m_colWidths.push_back( wxPG_DEFAULT_SPLITTERX );
m_colWidths.push_back( wxPG_DEFAULT_SPLITTERX ); m_colWidths.push_back( wxPG_DEFAULT_SPLITTERX );
m_fSplitterX = wxPG_DEFAULT_SPLITTERX;
m_columnProportions.push_back(1); m_columnProportions.push_back(1);
m_columnProportions.push_back(1); m_columnProportions.push_back(1);
m_isSplitterPreSet = false;
m_dontCenterSplitter = false;
// By default, we only have the 'value' column editable // By default, we only have the 'value' column editable
m_editableColumns.push_back(1); m_editableColumns.push_back(1);
} }