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
{
public:
wxGridCellChoiceRenderer(const wxString& choices = wxString());
explicit wxGridCellChoiceRenderer(const wxString& choices = wxString());
wxGridCellChoiceRenderer(const wxGridCellChoiceRenderer& other);
@@ -309,7 +309,7 @@ protected:
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellChoiceRenderer
{
public:
wxGridCellEnumRenderer(const wxString& choices = wxString())
explicit wxGridCellEnumRenderer(const wxString& choices = wxString())
: wxGridCellChoiceRenderer(choices)
{
}

View File

@@ -113,7 +113,7 @@ class WXDLLIMPEXP_ADV wxGridCellNumberEditor : public wxGridCellTextEditor
public:
// allows to specify the range - if min == max == -1, no range checking is
// done
wxGridCellNumberEditor(int min = -1, int max = -1)
explicit wxGridCellNumberEditor(int min = -1, int max = -1)
: wxGridCellTextEditor(),
m_min(min),
m_max(max)
@@ -207,7 +207,7 @@ enum wxGridCellFloatFormat
class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor
{
public:
wxGridCellFloatEditor(int width = -1,
explicit wxGridCellFloatEditor(int width = -1,
int precision = -1,
int format = wxGRID_FLOAT_FORMAT_DEFAULT)
: wxGridCellTextEditor(),
@@ -344,10 +344,10 @@ class WXDLLIMPEXP_ADV wxGridCellChoiceEditor : public wxGridCellEditor
{
public:
// 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,
bool allowOthers = false);
wxGridCellChoiceEditor(const wxArrayString& choices,
explicit wxGridCellChoiceEditor(const wxArrayString& choices,
bool allowOthers = false)
: wxGridCellEditor(),
m_choices(choices),
@@ -402,7 +402,7 @@ protected:
class WXDLLIMPEXP_ADV wxGridCellEnumEditor : public wxGridCellChoiceEditor
{
public:
wxGridCellEnumEditor(const wxString& choices = wxString());
explicit wxGridCellEnumEditor(const wxString& choices = wxString());
wxGridCellEnumEditor(const wxGridCellEnumEditor& other)
: wxGridCellChoiceEditor(other),