From 3e05d92dcb5f6c2017bc462554901ba27816bdb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Apr 2018 15:56:52 +0300 Subject: MNonCopyable - the common class to avoid declaring fake private constructors --- plugins/ClientChangeNotify/src/CString.cpp | 2 +- plugins/ClientChangeNotify/src/CString.h | 8 ++++---- plugins/ClientChangeNotify/src/Options.cpp | 2 +- plugins/ClientChangeNotify/src/Options.h | 4 +--- plugins/ClientChangeNotify/src/TMyArray.h | 8 ++++---- 5 files changed, 11 insertions(+), 13 deletions(-) (limited to 'plugins/ClientChangeNotify') diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index 2ed5f49062..d664213498 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -253,7 +253,7 @@ TString TString::ToLower() const template -TString& TString::operator = (const T *pStr) +TString& TString::operator=(const T *pStr) { if (pStr) { diff --git a/plugins/ClientChangeNotify/src/CString.h b/plugins/ClientChangeNotify/src/CString.h index decedaaac7..38d6080fba 100644 --- a/plugins/ClientChangeNotify/src/CString.h +++ b/plugins/ClientChangeNotify/src/CString.h @@ -68,16 +68,16 @@ public: T& operator [] (int nIndex) {_ASSERT(nIndex >= 0 && nIndex <= GetLen()); return pBuf[nIndex];} operator const T*() const {return pBuf;} operator T*() {return pBuf;} - TString& operator = (const T *pStr); - TString& operator = (const TString &Str) {return *this = Str.pBuf;} + TString& operator=(const T *pStr); + TString& operator=(const TString &Str) {return *this = Str.pBuf;} // TCString& operator + (const char *pStr) // {_ASSERT(pBuf && pStr); TCString Result(*this); return Result.Cat(pStr);} friend TString operator + (const TString &Str1, const T *Str2) {_ASSERT(Str1.pBuf && Str2); TString Result(Str1); return Result.Cat(Str2);} /* friend TCString operator + (const char *Str1, const TCString &Str2) {_ASSERT(Str1 && Str2.pBuf); TCString Result(Str1); return Result.Cat(Str2);}*/ - TString& operator += (const T *pStr) {_ASSERT(pBuf && pStr); return this->Cat(pStr);} - TString& operator += (const T c) {_ASSERT(pBuf); return this->Cat(c);} + TString& operator+=(const T *pStr) {_ASSERT(pBuf && pStr); return this->Cat(pStr);} + TString& operator+=(const T c) {_ASSERT(pBuf); return this->Cat(c);} int operator == (const T *pStr) const {return (!pBuf || !pStr) ? (pBuf == pStr) : !My_lstrcmp(pBuf, pStr);} int operator != (const T *pStr) const {return (!pBuf || !pStr) ? (pBuf != pStr) : My_lstrcmp(pBuf, pStr);} int operator < (const T *pStr) const {_ASSERT(pBuf && pStr); return My_lstrcmp(pBuf, pStr) > 0;} diff --git a/plugins/ClientChangeNotify/src/Options.cpp b/plugins/ClientChangeNotify/src/Options.cpp index cc1e3e6d96..e9674592a7 100644 --- a/plugins/ClientChangeNotify/src/Options.cpp +++ b/plugins/ClientChangeNotify/src/Options.cpp @@ -101,7 +101,7 @@ COptItem *COptPage::Find(int m_dlgItemID) return nullptr; } -COptPage& COptPage::operator = (const COptPage& Page) +COptPage& COptPage::operator=(const COptPage& Page) { hWnd = Page.hWnd; sModule = Page.sModule; diff --git a/plugins/ClientChangeNotify/src/Options.h b/plugins/ClientChangeNotify/src/Options.h index aac3e9d1c0..35f62f817c 100644 --- a/plugins/ClientChangeNotify/src/Options.h +++ b/plugins/ClientChangeNotify/src/Options.h @@ -61,7 +61,6 @@ public: int GetParam() { return lParam; } int GetID() { return m_dlgItemID; } - // virtual COptItem& operator = (const COptItem& Item) {return *this;}; virtual COptItem* Copy() { _ASSERT(0); return NULL; } // Attention! Free Copy() result when it's not needed anymore! CString sDBSetting; @@ -107,7 +106,6 @@ public: virtual INT_PTR GetValue() { return (INT_PTR)&sValue; } virtual INT_PTR GetDefValue() { return (INT_PTR)&sDefValue; } - // COptItem_Edit& operator = (const COptItem_Edit& Item) {return *this;}; virtual COptItem* Copy() { return new COptItem_Edit(*this); } TCString sDefValue; @@ -524,7 +522,7 @@ public: bool GetModified(); void SetModified(bool m_bModified); - COptPage& operator = (const COptPage& Page); + COptPage& operator=(const COptPage& Page); HWND hWnd; CString sModule, sDBSettingPrefix; diff --git a/plugins/ClientChangeNotify/src/TMyArray.h b/plugins/ClientChangeNotify/src/TMyArray.h index 3e676bf816..27bff9fd44 100644 --- a/plugins/ClientChangeNotify/src/TMyArray.h +++ b/plugins/ClientChangeNotify/src/TMyArray.h @@ -49,8 +49,8 @@ public: void RemoveAll(); const T& operator[](int nIndex) const; T& operator[](int nIndex); - TMyArray& operator = (const TMyArray &A); - TMyArray& operator += (const TMyArray &A); + TMyArray& operator=(const TMyArray &A); + TMyArray& operator+=(const TMyArray &A); private: int SetAllocNum(int nNewAllocNum); @@ -328,7 +328,7 @@ __forceinline T& TMyArray::operator[](int nInde } template -__forceinline TMyArray& TMyArray::operator = (const TMyArray &A) +__forceinline TMyArray& TMyArray::operator=(const TMyArray &A) { RemoveAll(); int I; @@ -340,7 +340,7 @@ __forceinline TMyArray& TMyArray -__forceinline TMyArray& TMyArray::operator += (const TMyArray &A) +__forceinline TMyArray& TMyArray::operator+=(const TMyArray &A) { int I; for (I = 0; I < A.GetSize(); I++) -- cgit v1.2.3