From b2c31e32de4376d44852e2e9db7be028e383676a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 25 Mar 2008 13:45:40 +0000 Subject: [PATCH] implement wxListItem::operator=() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52811 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/listbase.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/include/wx/listbase.h b/include/wx/listbase.h index 4e4725aaba..a2ca6ce5f2 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -235,6 +235,24 @@ public: if ( item.HasAttributes() ) m_attr = new wxListItemAttr(*item.GetAttributes()); } + + wxListItem& operator=(const wxListItem& item) + { + m_mask = item.m_mask; + m_itemId = item.m_itemId; + m_col = item.m_col; + m_state = item.m_state; + m_stateMask = item.m_stateMask; + m_text = item.m_text; + m_image = item.m_image; + m_data = item.m_data; + m_format = item.m_format; + m_width = item.m_width; + m_attr = item.m_attr ? new wxListItemAttr(*item.m_attr) : NULL; + + return *this; + } + virtual ~wxListItem() { delete m_attr; } // resetting @@ -346,9 +364,6 @@ protected: wxListItemAttr *m_attr; // optional pointer to the items style private: - // VZ: this is strange, we have a copy ctor but not operator=(), why? - wxListItem& operator=(const wxListItem& item); - DECLARE_DYNAMIC_CLASS(wxListItem) }; -- 2.45.2