Make more ctors of wxGrid classes explicit

Don't allow nonsensical implicit conversion from int to
wxGridCellFloatFormat etc.

No real changes.
This commit is contained in:
Vadim Zeitlin
2022-04-28 00:30:44 +02:00
parent 5db2244bc8
commit de8877d3ee
2 changed files with 12 additions and 12 deletions

View File

@@ -283,7 +283,7 @@ protected:
class WXDLLIMPEXP_ADV wxGridCellChoiceRenderer : public wxGridCellStringRenderer class WXDLLIMPEXP_ADV wxGridCellChoiceRenderer : public wxGridCellStringRenderer
{ {
public: public:
wxGridCellChoiceRenderer(const wxString& choices = wxString()); explicit wxGridCellChoiceRenderer(const wxString& choices = wxString());
wxGridCellChoiceRenderer(const wxGridCellChoiceRenderer& other); wxGridCellChoiceRenderer(const wxGridCellChoiceRenderer& other);
@@ -309,7 +309,7 @@ protected:
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellChoiceRenderer class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellChoiceRenderer
{ {
public: public:
wxGridCellEnumRenderer(const wxString& choices = wxString()) explicit wxGridCellEnumRenderer(const wxString& choices = wxString())
: wxGridCellChoiceRenderer(choices) : wxGridCellChoiceRenderer(choices)
{ {
} }

View File

@@ -113,7 +113,7 @@ class WXDLLIMPEXP_ADV wxGridCellNumberEditor : public wxGridCellTextEditor
public: public:
// allows to specify the range - if min == max == -1, no range checking is // allows to specify the range - if min == max == -1, no range checking is
// done // done
wxGridCellNumberEditor(int min = -1, int max = -1) explicit wxGridCellNumberEditor(int min = -1, int max = -1)
: wxGridCellTextEditor(), : wxGridCellTextEditor(),
m_min(min), m_min(min),
m_max(max) m_max(max)
@@ -207,7 +207,7 @@ enum wxGridCellFloatFormat
class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor
{ {
public: public:
wxGridCellFloatEditor(int width = -1, explicit wxGridCellFloatEditor(int width = -1,
int precision = -1, int precision = -1,
int format = wxGRID_FLOAT_FORMAT_DEFAULT) int format = wxGRID_FLOAT_FORMAT_DEFAULT)
: wxGridCellTextEditor(), : wxGridCellTextEditor(),
@@ -344,10 +344,10 @@ class WXDLLIMPEXP_ADV wxGridCellChoiceEditor : public wxGridCellEditor
{ {
public: public:
// if !allowOthers, user can't type a string not in choices array // if !allowOthers, user can't type a string not in choices array
wxGridCellChoiceEditor(size_t count = 0, explicit wxGridCellChoiceEditor(size_t count = 0,
const wxString choices[] = NULL, const wxString choices[] = NULL,
bool allowOthers = false); bool allowOthers = false);
wxGridCellChoiceEditor(const wxArrayString& choices, explicit wxGridCellChoiceEditor(const wxArrayString& choices,
bool allowOthers = false) bool allowOthers = false)
: wxGridCellEditor(), : wxGridCellEditor(),
m_choices(choices), m_choices(choices),
@@ -402,7 +402,7 @@ protected:
class WXDLLIMPEXP_ADV wxGridCellEnumEditor : public wxGridCellChoiceEditor class WXDLLIMPEXP_ADV wxGridCellEnumEditor : public wxGridCellChoiceEditor
{ {
public: public:
wxGridCellEnumEditor(const wxString& choices = wxString()); explicit wxGridCellEnumEditor(const wxString& choices = wxString());
wxGridCellEnumEditor(const wxGridCellEnumEditor& other) wxGridCellEnumEditor(const wxGridCellEnumEditor& other)
: wxGridCellChoiceEditor(other), : wxGridCellChoiceEditor(other),