diff --git a/include/wx/cmndata.h b/include/wx/cmndata.h index 3ecfc402a8..0bfced12f3 100644 --- a/include/wx/cmndata.h +++ b/include/wx/cmndata.h @@ -37,7 +37,7 @@ public: wxColourData(); wxColourData(const wxColourData& data); - void operator=(const wxColourData&); + wxColourData& operator=(const wxColourData& data); virtual ~wxColourData(); void SetChooseFull(bool flag) { m_chooseFull = flag; } diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 40e6073529..2efed738be 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -78,7 +78,7 @@ wxColourData::wxColourData() } wxColourData::wxColourData(const wxColourData& data) - : wxObject() + : wxObject() { (*this) = data; } @@ -102,13 +102,15 @@ wxColour wxColourData::GetCustomColour(int i) return m_custColours[i]; } -void wxColourData::operator=(const wxColourData& data) +wxColourData& wxColourData::operator=(const wxColourData& data) { for (int i = 0; i < WXSIZEOF(m_custColours); i++) m_custColours[i] = data.m_custColours[i]; m_dataColour = data.m_dataColour; m_chooseFull = data.m_chooseFull; + + return *this; } // ----------------------------------------------------------------------------