Make wxColourData parameter of wxColourDialog ctor const
This parameter is not modified by wxColourDialog (this might have been the case, or at least the plan, some long time ago) and so has no reason not to be "const". Just add the qualifier to ctor and Create() in all ports. Closes https://github.com/wxWidgets/wxWidgets/pull/1421 Closes #12511.
This commit is contained in:
committed by
Vadim Zeitlin
parent
e21c4c78ca
commit
1879e8e646
@@ -37,10 +37,10 @@ class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
|
||||
public:
|
||||
wxGenericColourDialog();
|
||||
wxGenericColourDialog(wxWindow *parent,
|
||||
wxColourData *data = NULL);
|
||||
const wxColourData *data = NULL);
|
||||
virtual ~wxGenericColourDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
wxColourData &GetColourData() { return m_colourData; }
|
||||
|
||||
|
@@ -18,10 +18,10 @@ class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
|
||||
public:
|
||||
wxColourDialog() {}
|
||||
wxColourDialog(wxWindow *parent,
|
||||
wxColourData *data = NULL);
|
||||
const wxColourData *data = NULL);
|
||||
virtual ~wxColourDialog() {}
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
wxColourData &GetColourData() { return m_data; }
|
||||
|
||||
|
@@ -21,14 +21,14 @@ class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxColourDialog() { Init(); }
|
||||
wxColourDialog(wxWindow *parent, wxColourData *data = NULL)
|
||||
wxColourDialog(wxWindow *parent, const wxColourData *data = NULL)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, data);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
wxColourData& GetColourData() { return m_colourData; }
|
||||
|
||||
|
@@ -23,9 +23,9 @@ class WXDLLIMPEXP_CORE wxColourDialog: public wxDialog
|
||||
wxDECLARE_DYNAMIC_CLASS(wxColourDialog);
|
||||
public:
|
||||
wxColourDialog();
|
||||
wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
|
||||
wxColourDialog(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
int ShowModal() wxOVERRIDE;
|
||||
wxColourData& GetColourData() { return m_colourData; }
|
||||
|
@@ -17,9 +17,9 @@ class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
|
||||
public:
|
||||
wxColourDialog() { }
|
||||
wxColourDialog(wxWindow *parent,
|
||||
wxColourData *data = NULL) { Create(parent, data); }
|
||||
const wxColourData *data = NULL) { Create(parent, data); }
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
wxColourData &GetColourData();
|
||||
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
@see wxColourData
|
||||
*/
|
||||
wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
|
||||
wxColourDialog(wxWindow* parent, const wxColourData* data = NULL);
|
||||
|
||||
/**
|
||||
Destructor.
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
/**
|
||||
Same as wxColourDialog().
|
||||
*/
|
||||
bool Create(wxWindow* parent, wxColourData* data = NULL);
|
||||
bool Create(wxWindow* parent, const wxColourData* data = NULL);
|
||||
|
||||
/**
|
||||
Returns the colour data associated with the colour dialog.
|
||||
|
@@ -136,7 +136,7 @@ wxGenericColourDialog::wxGenericColourDialog()
|
||||
}
|
||||
|
||||
wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent,
|
||||
wxColourData *data)
|
||||
const wxColourData *data)
|
||||
{
|
||||
m_whichKind = 1;
|
||||
m_colourSelection = -1;
|
||||
@@ -152,7 +152,7 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
bool wxGenericColourDialog::Create(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
if ( !wxDialog::Create(GetParentForModalDialog(parent, 0), wxID_ANY,
|
||||
_("Choose colour"),
|
||||
|
@@ -35,12 +35,12 @@ static void response(GtkDialog*, int response_id, wxColourDialog* win)
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog);
|
||||
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
Create(parent, data);
|
||||
}
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
bool wxColourDialog::Create(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
if (data)
|
||||
m_data = *data;
|
||||
|
@@ -166,7 +166,7 @@ void wxColourDialog::Init()
|
||||
gs_rectDialog.y = 0;
|
||||
}
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
bool wxColourDialog::Create(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
m_parent = parent;
|
||||
if (data)
|
||||
|
@@ -31,12 +31,12 @@ wxColourDialog::wxColourDialog()
|
||||
m_dialogParent = NULL;
|
||||
}
|
||||
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
Create(parent, data);
|
||||
}
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
bool wxColourDialog::Create(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
m_dialogParent = parent;
|
||||
|
||||
|
@@ -90,12 +90,12 @@ wxColourDialog::wxColourDialog()
|
||||
m_dialogParent = NULL;
|
||||
}
|
||||
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data)
|
||||
wxColourDialog::wxColourDialog(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
Create(parent, data);
|
||||
}
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
|
||||
bool wxColourDialog::Create(wxWindow *parent, const wxColourData *data)
|
||||
{
|
||||
m_dialogParent = parent;
|
||||
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxColourDialog,wxDialog)
|
||||
|
||||
bool wxColourDialog::Create(wxWindow *parent, wxColourData *data )
|
||||
bool wxColourDialog::Create(wxWindow *parent, const wxColourData *data )
|
||||
{
|
||||
m_qtWindow = new wxQtColorDialog( parent, this );
|
||||
|
||||
|
Reference in New Issue
Block a user