From: Gilles Depeyrot Date: Tue, 7 May 2002 20:40:04 +0000 (+0000) Subject: implemented explicit copy constructor and assignement operator X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/54380f29f05b666338bd0a61487304ded2d57255 implemented explicit copy constructor and assignement operator git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/accel.h b/include/wx/accel.h index 986ea9b66d..02bac45939 100644 --- a/include/wx/accel.h +++ b/include/wx/accel.h @@ -44,10 +44,25 @@ class WXDLLEXPORT wxAcceleratorEntry public: wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0, wxMenuItem *item = NULL) + : m_flags(flags) + , m_keyCode(keyCode) + , m_command(cmd) + , m_item(item) + { } + + wxAcceleratorEntry(const wxAcceleratorEntry& entry) + : m_flags(entry.m_flags) + , m_keyCode(entry.m_keyCode) + , m_command(entry.m_command) + , m_item(entry.m_item) + { } + + wxAcceleratorEntry& operator=(const wxAcceleratorEntry& entry) { - Set(flags, keyCode, cmd, item); + Set(entry.m_flags, entry.m_keyCode, entry.m_command, entry.m_item); + return *this; } - + void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL) { m_flags = flags; diff --git a/include/wx/strconv.h b/include/wx/strconv.h index a329062f5c..81015e3240 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -124,8 +124,11 @@ class WXDLLEXPORT wxCSConv : public wxMBConv { public: wxCSConv(const wxChar *charset); + wxCSConv(const wxCSConv& conv); virtual ~wxCSConv(); + wxCSConv& operator=(const wxCSConv& conv); + void LoadNow(); virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 677ad2714d..bdb210d538 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -920,6 +920,20 @@ wxCSConv::~wxCSConv() Clear(); } +wxCSConv::wxCSConv(const wxCSConv& conv) + : wxMBConv() +{ + Clear(); + SetName(conv.m_name); +} + +wxCSConv& wxCSConv::operator=(const wxCSConv& conv) +{ + Clear(); + SetName(conv.m_name); + return *this; +} + void wxCSConv::Clear() { if (m_name)