Revert "Fix fields initialization in wxCommandEvent copy ctor."

This reverts commit 62763ad541 which seems to
have been completely unnecessary as the fields had been already initialized
and this commit actually broke initialization of the propagation level of the
copied wxCommandEvent objects.

Add a unit test proving that things do work.

Closes #16739.
This commit is contained in:
Vadim Zeitlin
2016-01-30 05:00:43 +01:00
parent a7d31701ab
commit 5dd5d68e67
2 changed files with 32 additions and 10 deletions

View File

@@ -1502,8 +1502,10 @@ public:
{
m_clientData = NULL;
m_clientObject = NULL;
m_isCommandEvent = true;
Init();
// the command events are propagated upwards by default
m_propagationLevel = wxEVENT_PROPAGATE_MAX;
}
wxCommandEvent(const wxCommandEvent& event)
@@ -1516,8 +1518,6 @@ public:
// need to copy it explicitly.
if ( m_cmdString.empty() )
m_cmdString = event.GetString();
Init();
}
// Set/Get client data from controls
@@ -1549,13 +1549,6 @@ protected:
wxClientData* m_clientObject; // Arbitrary client object
private:
void Init()
{
m_isCommandEvent = true;
// the command events are propagated upwards by default
m_propagationLevel = wxEVENT_PROPAGATE_MAX;
}
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent);
};