Use ctor-initializer rather than assignment for non-POD class members
This commit is contained in:
@@ -231,8 +231,8 @@ public:
|
||||
{
|
||||
public:
|
||||
DataHolder(const T2& value)
|
||||
: m_value(value)
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
virtual ~DataHolder() { }
|
||||
|
||||
|
@@ -69,10 +69,10 @@ public:
|
||||
wxAuiToolBarEvent(wxEventType commandType = wxEVT_NULL,
|
||||
int winId = 0)
|
||||
: wxNotifyEvent(commandType, winId)
|
||||
, m_clickPt(-1, -1)
|
||||
, m_rect(-1, -1, 0, 0)
|
||||
{
|
||||
m_isDropdownClicked = false;
|
||||
m_clickPt = wxPoint(-1, -1);
|
||||
m_rect = wxRect(-1,-1, 0, 0);
|
||||
m_toolId = -1;
|
||||
}
|
||||
wxEvent *Clone() const wxOVERRIDE { return new wxAuiToolBarEvent(*this); }
|
||||
|
@@ -148,6 +148,11 @@ class WXDLLIMPEXP_AUI wxAuiPaneInfo
|
||||
public:
|
||||
|
||||
wxAuiPaneInfo()
|
||||
: best_size(wxDefaultSize)
|
||||
, min_size(wxDefaultSize)
|
||||
, max_size(wxDefaultSize)
|
||||
, floating_pos(wxDefaultPosition)
|
||||
, floating_size(wxDefaultSize)
|
||||
{
|
||||
window = NULL;
|
||||
frame = NULL;
|
||||
@@ -156,11 +161,6 @@ public:
|
||||
dock_layer = 0;
|
||||
dock_row = 0;
|
||||
dock_pos = 0;
|
||||
floating_pos = wxDefaultPosition;
|
||||
floating_size = wxDefaultSize;
|
||||
best_size = wxDefaultSize;
|
||||
min_size = wxDefaultSize;
|
||||
max_size = wxDefaultSize;
|
||||
dock_proportion = 0;
|
||||
|
||||
DefaultPane();
|
||||
|
@@ -40,7 +40,7 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxColourPickerCtrlNameStr[];
|
||||
class WXDLLIMPEXP_CORE wxColourPickerWidgetBase
|
||||
{
|
||||
public:
|
||||
wxColourPickerWidgetBase() { m_colour = *wxBLACK; }
|
||||
wxColourPickerWidgetBase() : m_colour(*wxBLACK) { }
|
||||
virtual ~wxColourPickerWidgetBase() {}
|
||||
|
||||
wxColour GetColour() const
|
||||
|
@@ -464,7 +464,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// default ctor does not initialize the object, use Set()!
|
||||
wxDateTime() { m_time = wxINT64_MIN; }
|
||||
wxDateTime() : m_time(wxINT64_MIN) { }
|
||||
|
||||
// from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970)
|
||||
inline wxDateTime(time_t timet);
|
||||
@@ -1114,7 +1114,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// construct from internal representation
|
||||
wxDateTime(const wxLongLong& time) { m_time = time; }
|
||||
wxDateTime(const wxLongLong& time) : m_time(time) { }
|
||||
|
||||
// get the internal representation
|
||||
inline wxLongLong GetValue() const;
|
||||
@@ -1343,7 +1343,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
// construct from internal representation
|
||||
wxTimeSpan(const wxLongLong& diff) { m_diff = diff; }
|
||||
wxTimeSpan(const wxLongLong& diff) : m_diff(diff) { }
|
||||
|
||||
// get the internal representation
|
||||
wxLongLong GetValue() const { return m_diff; }
|
||||
|
@@ -160,7 +160,7 @@ public:
|
||||
// The class of wxEvent-derived class carried by the events of this type.
|
||||
typedef T EventClass;
|
||||
|
||||
wxEventTypeTag(wxEventType type) { m_type = type; }
|
||||
wxEventTypeTag(wxEventType type) : m_type(type) { }
|
||||
|
||||
// Return a wxEventType reference for the initialization of the static
|
||||
// event tables. See wxEventTableEntry::m_eventType for a more thorough
|
||||
@@ -1898,8 +1898,8 @@ public:
|
||||
}
|
||||
|
||||
wxGestureEvent(const wxGestureEvent& event) : wxEvent(event)
|
||||
, m_pos(event.m_pos)
|
||||
{
|
||||
m_pos = event.m_pos;
|
||||
m_isStart = event.m_isStart;
|
||||
m_isEnd = event.m_isEnd;
|
||||
}
|
||||
|
@@ -38,14 +38,14 @@ public:
|
||||
, wxDateTime modif
|
||||
#endif // wxUSE_DATETIME
|
||||
)
|
||||
: m_Location(loc)
|
||||
, m_MimeType(mimetype.Lower())
|
||||
, m_Anchor(anchor)
|
||||
#if wxUSE_DATETIME
|
||||
, m_Modif(modif)
|
||||
#endif
|
||||
{
|
||||
m_Stream = stream;
|
||||
m_Location = loc;
|
||||
m_MimeType = mimetype.Lower();
|
||||
m_Anchor = anchor;
|
||||
#if wxUSE_DATETIME
|
||||
m_Modif = modif;
|
||||
#endif // wxUSE_DATETIME
|
||||
}
|
||||
|
||||
virtual ~wxFSFile() { delete m_Stream; }
|
||||
|
@@ -43,8 +43,8 @@ class wxGtkCollatableString
|
||||
{
|
||||
public:
|
||||
wxGtkCollatableString( const wxString &label, gchar *key )
|
||||
: m_label(label)
|
||||
{
|
||||
m_label = label;
|
||||
m_key = key;
|
||||
}
|
||||
|
||||
|
@@ -32,11 +32,11 @@ class WXDLLIMPEXP_HTML wxHtmlBookRecord
|
||||
public:
|
||||
wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
|
||||
const wxString& title, const wxString& start)
|
||||
: m_BookFile(bookfile)
|
||||
, m_BasePath(basepath)
|
||||
, m_Title(title)
|
||||
, m_Start(start)
|
||||
{
|
||||
m_BookFile = bookfile;
|
||||
m_BasePath = basepath;
|
||||
m_Title = title;
|
||||
m_Start = start;
|
||||
// for debugging, give the contents index obvious default values
|
||||
m_ContentsStart = m_ContentsEnd = -1;
|
||||
}
|
||||
|
@@ -571,7 +571,7 @@ protected:
|
||||
class WXDLLIMPEXP_HTML wxHtmlColourCell : public wxHtmlCell
|
||||
{
|
||||
public:
|
||||
wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell() {m_Colour = clr; m_Flags = flags;}
|
||||
wxHtmlColourCell(const wxColour& clr, int flags = wxHTML_CLR_FOREGROUND) : wxHtmlCell(), m_Colour(clr) { m_Flags = flags;}
|
||||
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
|
||||
wxHtmlRenderingInfo& info) wxOVERRIDE;
|
||||
virtual void DrawInvisible(wxDC& dc, int x, int y,
|
||||
@@ -596,7 +596,7 @@ protected:
|
||||
class WXDLLIMPEXP_HTML wxHtmlFontCell : public wxHtmlCell
|
||||
{
|
||||
public:
|
||||
wxHtmlFontCell(wxFont *font) : wxHtmlCell() { m_Font = (*font); }
|
||||
wxHtmlFontCell(wxFont *font) : wxHtmlCell(), m_Font(*font) { }
|
||||
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2,
|
||||
wxHtmlRenderingInfo& info) wxOVERRIDE;
|
||||
virtual void DrawInvisible(wxDC& dc, int x, int y,
|
||||
|
@@ -578,10 +578,10 @@ public:
|
||||
wxHtmlCell *cell, const wxPoint &pt,
|
||||
const wxMouseEvent &ev)
|
||||
: wxCommandEvent(commandType, id)
|
||||
, m_mouseEvent(ev)
|
||||
, m_pt(pt)
|
||||
{
|
||||
m_cell = cell;
|
||||
m_pt = pt;
|
||||
m_mouseEvent = ev;
|
||||
m_bLinkWasClicked = false;
|
||||
}
|
||||
|
||||
|
@@ -81,9 +81,9 @@ public:
|
||||
|
||||
wxColourPropertyValue( const wxColourPropertyValue& v )
|
||||
: wxObject()
|
||||
, m_colour(v.m_colour)
|
||||
{
|
||||
m_type = v.m_type;
|
||||
m_colour = v.m_colour;
|
||||
}
|
||||
|
||||
void Init( wxUint32 type, const wxColour& colour )
|
||||
@@ -94,9 +94,9 @@ public:
|
||||
|
||||
wxColourPropertyValue( const wxColour& colour )
|
||||
: wxObject()
|
||||
, m_colour(colour)
|
||||
{
|
||||
m_type = wxPG_COLOUR_CUSTOM;
|
||||
m_colour = colour;
|
||||
}
|
||||
|
||||
wxColourPropertyValue( wxUint32 type )
|
||||
|
@@ -338,8 +338,8 @@ class WXDLLIMPEXP_PROPGRID wxPGCommonValue
|
||||
public:
|
||||
|
||||
wxPGCommonValue( const wxString& label, wxPGCellRenderer* renderer )
|
||||
: m_label(label)
|
||||
{
|
||||
m_label = label;
|
||||
m_renderer = renderer;
|
||||
renderer->IncRef();
|
||||
}
|
||||
|
@@ -485,7 +485,7 @@ class classname##VariantData: public wxVariantData \
|
||||
{ \
|
||||
public:\
|
||||
classname##VariantData() {} \
|
||||
classname##VariantData( const classname &value ) { m_value = value; } \
|
||||
classname##VariantData( const classname &value ) : m_value(value) { } \
|
||||
\
|
||||
classname &GetValue() { return m_value; } \
|
||||
\
|
||||
|
@@ -25,13 +25,13 @@ public:
|
||||
int micro = 0,
|
||||
const wxString& description = wxString(),
|
||||
const wxString& copyright = wxString())
|
||||
: m_name(name)
|
||||
, m_description(description)
|
||||
, m_copyright(copyright)
|
||||
{
|
||||
m_name = name;
|
||||
m_major = major;
|
||||
m_minor = minor;
|
||||
m_micro = micro;
|
||||
m_description = description;
|
||||
m_copyright = copyright;
|
||||
}
|
||||
|
||||
// Default copy ctor, assignment operator and dtor are ok.
|
||||
|
Reference in New Issue
Block a user