Use ctor-initializer rather than assignment for non-POD class members
This commit is contained in:
@@ -20,27 +20,26 @@ class LifePattern
|
||||
{
|
||||
public:
|
||||
// This ctor is used by the LifeReader class
|
||||
LifePattern(wxString name,
|
||||
wxString description,
|
||||
wxString rules,
|
||||
wxArrayString shape)
|
||||
LifePattern(const wxString& name,
|
||||
const wxString& description,
|
||||
const wxString& rules,
|
||||
const wxArrayString& shape)
|
||||
: m_name(name)
|
||||
, m_description(description)
|
||||
, m_rules(rules)
|
||||
, m_shape(shape)
|
||||
{
|
||||
m_name = name;
|
||||
m_description = description;
|
||||
m_rules = rules;
|
||||
m_shape = shape;
|
||||
}
|
||||
|
||||
// A more convenient ctor for the built-in samples
|
||||
LifePattern(wxString name,
|
||||
wxString description,
|
||||
LifePattern(const wxString& name,
|
||||
const wxString& description,
|
||||
int width,
|
||||
int height,
|
||||
const char *shape)
|
||||
: m_name(name)
|
||||
, m_description(description)
|
||||
{
|
||||
m_name = name;
|
||||
m_description = description;
|
||||
m_rules = wxEmptyString;
|
||||
// TODO: add the positions later, since the formatting command
|
||||
// causes a crash due to conversion objects not being available
|
||||
// during initialisation.
|
||||
|
@@ -517,7 +517,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; } \
|
||||
\
|
||||
|
@@ -154,11 +154,11 @@ wxTreeEvent::wxTreeEvent(wxEventType commandType, int id)
|
||||
wxTreeEvent::wxTreeEvent(const wxTreeEvent & event)
|
||||
: wxNotifyEvent(event)
|
||||
, m_evtKey(event.m_evtKey)
|
||||
, m_item(event.m_item)
|
||||
, m_itemOld(event.m_itemOld)
|
||||
, m_pointDrag(event.m_pointDrag)
|
||||
, m_label(event.m_label)
|
||||
{
|
||||
m_item = event.m_item;
|
||||
m_itemOld = event.m_itemOld;
|
||||
m_editCancelled = event.m_editCancelled;
|
||||
}
|
||||
|
||||
|
@@ -292,8 +292,8 @@ bool wxHtmlCell::IsBefore(wxHtmlCell *cell) const
|
||||
wxIMPLEMENT_ABSTRACT_CLASS(wxHtmlWordCell, wxHtmlCell);
|
||||
|
||||
wxHtmlWordCell::wxHtmlWordCell(const wxString& word, const wxDC& dc) : wxHtmlCell()
|
||||
, m_Word(word)
|
||||
{
|
||||
m_Word = word;
|
||||
wxCoord w, h, d;
|
||||
dc.GetTextExtent(m_Word, &w, &h, &d);
|
||||
m_Width = w;
|
||||
|
@@ -158,6 +158,7 @@ wxPenRefData::wxPenRefData()
|
||||
|
||||
wxPenRefData::wxPenRefData(const wxPenRefData& data)
|
||||
:wxGDIRefData()
|
||||
, m_colour(data.m_colour)
|
||||
{
|
||||
m_style = data.m_style;
|
||||
m_width = data.m_width;
|
||||
@@ -165,11 +166,12 @@ wxPenRefData::wxPenRefData(const wxPenRefData& data)
|
||||
m_cap = data.m_cap;
|
||||
m_nbDash = data.m_nbDash;
|
||||
m_dash = data.m_dash;
|
||||
m_colour = data.m_colour;
|
||||
m_hPen = 0;
|
||||
}
|
||||
|
||||
wxPenRefData::wxPenRefData(const wxPenInfo& info)
|
||||
: m_stipple(info.GetStipple())
|
||||
, m_colour(info.GetColour())
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -177,9 +179,7 @@ wxPenRefData::wxPenRefData(const wxPenInfo& info)
|
||||
m_width = info.GetWidth();
|
||||
m_join = info.GetJoin();
|
||||
m_cap = info.GetCap();
|
||||
m_stipple = info.GetStipple();
|
||||
m_nbDash = info.GetDashes(&m_dash);
|
||||
m_colour = info.GetColour();
|
||||
}
|
||||
|
||||
wxPenRefData::~wxPenRefData()
|
||||
|
@@ -266,13 +266,13 @@ static const char * const ribbon_help_button_xpm[] = {
|
||||
};
|
||||
|
||||
wxRibbonMSWArtProvider::wxRibbonMSWArtProvider(bool set_colour_scheme)
|
||||
#if defined( __WXMAC__ )
|
||||
: m_tab_label_font(*wxSMALL_FONT)
|
||||
#else
|
||||
: m_tab_label_font(*wxNORMAL_FONT)
|
||||
#endif
|
||||
{
|
||||
m_flags = 0;
|
||||
#if defined( __WXMAC__ )
|
||||
m_tab_label_font = *wxSMALL_FONT;
|
||||
#else
|
||||
m_tab_label_font = *wxNORMAL_FONT;
|
||||
#endif
|
||||
m_button_bar_label_font = m_tab_label_font;
|
||||
m_panel_label_font = m_tab_label_font;
|
||||
|
||||
|
@@ -258,8 +258,8 @@ int wxRichTextFloatCollector::GetWidthFromFloatRect(const wxRichTextFloatRectMap
|
||||
}
|
||||
|
||||
wxRichTextFloatCollector::wxRichTextFloatCollector(const wxRect& rect) : m_left(wxRichTextFloatRectMapCmp), m_right(wxRichTextFloatRectMapCmp)
|
||||
, m_availableRect(rect)
|
||||
{
|
||||
m_availableRect = rect;
|
||||
m_para = NULL;
|
||||
}
|
||||
|
||||
@@ -14317,13 +14317,15 @@ void wxTextAttrDimension::CollectCommonAttributes(const wxTextAttrDimension& att
|
||||
}
|
||||
|
||||
wxTextAttrDimensionConverter::wxTextAttrDimensionConverter(wxDC& dc, double scale, const wxSize& parentSize)
|
||||
: m_parentSize(parentSize)
|
||||
{
|
||||
m_ppi = dc.GetPPI().x; m_scale = scale; m_parentSize = parentSize;
|
||||
m_ppi = dc.GetPPI().x; m_scale = scale;
|
||||
}
|
||||
|
||||
wxTextAttrDimensionConverter::wxTextAttrDimensionConverter(int ppi, double scale, const wxSize& parentSize)
|
||||
: m_parentSize(parentSize)
|
||||
{
|
||||
m_ppi = ppi; m_scale = scale; m_parentSize = parentSize;
|
||||
m_ppi = ppi; m_scale = scale;
|
||||
}
|
||||
|
||||
int wxTextAttrDimensionConverter::ConvertTenthsMMToPixels(int units) const
|
||||
|
@@ -447,16 +447,15 @@ bool wxRichTextPrintout::SubstituteKeywords(wxString& str, const wxString& title
|
||||
*/
|
||||
|
||||
wxRichTextPrinting::wxRichTextPrinting(const wxString& name, wxWindow *parentWindow)
|
||||
: m_title(name)
|
||||
, m_previewRect(100, 100, 800, 800)
|
||||
{
|
||||
m_richTextBufferPrinting = NULL;
|
||||
m_richTextBufferPreview = NULL;
|
||||
|
||||
m_parentWindow = parentWindow;
|
||||
m_title = name;
|
||||
m_printData = NULL;
|
||||
|
||||
m_previewRect = wxRect(wxPoint(100, 100), wxSize(800, 800));
|
||||
|
||||
m_pageSetupData = new wxPageSetupDialogData;
|
||||
m_pageSetupData->EnableMargins(true);
|
||||
m_pageSetupData->SetMarginTopLeft(wxPoint(25, 25));
|
||||
|
@@ -279,6 +279,14 @@ private:
|
||||
|
||||
|
||||
wxDialUpManagerImpl::wxDialUpManagerImpl()
|
||||
: m_BeaconHost(WXDIALUP_MANAGER_DEFAULT_BEACONHOST)
|
||||
#ifdef __SGI__
|
||||
, m_ConnectCommand("/usr/etc/ppp")
|
||||
#elif defined(__LINUX__)
|
||||
// default values for Debian/GNU linux
|
||||
, m_ConnectCommand("pon")
|
||||
, m_HangUpCommand("poff")
|
||||
#endif
|
||||
{
|
||||
m_IsOnline =
|
||||
m_connCard = Net_Unknown;
|
||||
@@ -286,17 +294,8 @@ wxDialUpManagerImpl::wxDialUpManagerImpl()
|
||||
m_timer = NULL;
|
||||
m_CanUseIfconfig = -1; // unknown
|
||||
m_CanUsePing = -1; // unknown
|
||||
m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST;
|
||||
m_BeaconPort = 80;
|
||||
|
||||
#ifdef __SGI__
|
||||
m_ConnectCommand = wxT("/usr/etc/ppp");
|
||||
#elif defined(__LINUX__)
|
||||
// default values for Debian/GNU linux
|
||||
m_ConnectCommand = wxT("pon");
|
||||
m_HangUpCommand = wxT("poff");
|
||||
#endif
|
||||
|
||||
wxChar * dial = wxGetenv(wxT("WXDIALUP_DIALCMD"));
|
||||
wxChar * hup = wxGetenv(wxT("WXDIALUP_HUPCMD"));
|
||||
SetConnectCommand(dial ? wxString(dial) : m_ConnectCommand,
|
||||
|
@@ -64,11 +64,11 @@ class WXDLLEXPORT wxDialUpManagerImpl : public wxDialUpManager
|
||||
{
|
||||
public:
|
||||
wxDialUpManagerImpl()
|
||||
: m_BeaconHost(WXDIALUP_MANAGER_DEFAULT_BEACONHOST)
|
||||
{
|
||||
m_IsOnline = -1; // unknown
|
||||
m_timer = NULL;
|
||||
m_CanUseIfconfig = -1; // unknown
|
||||
m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST;
|
||||
m_BeaconPort = 80;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user