Add DECLARE_COPY_AND_OPEQ to util classes

Make operator= and the copy constructor private in all of the classes
in the utility library and the base classes in reformat.
This commit is contained in:
Andy McFadden 2014-12-04 11:11:26 -08:00
parent 94beec0639
commit 66660a1fe4
15 changed files with 48 additions and 2 deletions

View File

@ -332,6 +332,8 @@ protected:
const char* GetNameExt(void) const { return fNameExt; } const char* GetNameExt(void) const { return fNameExt; }
private: private:
DECLARE_COPY_AND_OPEQ(ReformatHolder)
/* /*
* Utility functions. * Utility functions.
*/ */
@ -427,6 +429,8 @@ public:
} }
private: private:
DECLARE_COPY_AND_OPEQ(ReformatOutput)
/* what we're holding */ /* what we're holding */
OutputKind fOutputKind; OutputKind fOutputKind;
//ReformatID fOutputID; //ReformatID fOutputID;
@ -482,8 +486,8 @@ public:
} }
private: private:
NiftyList(void) { assert(false); } NiftyList(void); // do not instantiate
~NiftyList(void) {} ~NiftyList(void);
/* /*
* Structures for holding data. * Structures for holding data.

View File

@ -131,6 +131,9 @@ public:
else else
return Get32BE(buf); return Get32BE(buf);
} }
private:
DECLARE_COPY_AND_OPEQ(Reformat)
}; };
/* /*
@ -164,6 +167,8 @@ protected:
uint8_t** pOutPtr, long dstLen, uint8_t xorVal); uint8_t** pOutPtr, long dstLen, uint8_t xorVal);
private: private:
DECLARE_COPY_AND_OPEQ(ReformatGraphics)
void InitPalette(); void InitPalette();
}; };
@ -369,6 +374,7 @@ protected:
void CheckGSCharConv(void); void CheckGSCharConv(void);
private: private:
DECLARE_COPY_AND_OPEQ(ReformatText)
int CreateWorkBuf(void); int CreateWorkBuf(void);
enum { kRTFUnitsPerInch = 1440 }; // TWIPS enum { kRTFUnitsPerInch = 1440 }; // TWIPS

View File

@ -36,6 +36,8 @@ protected:
bool* fpCancelFlag; bool* fpCancelFlag;
private: private:
DECLARE_COPY_AND_OPEQ(CancelDialog)
/* override Cancel button to just raise the flag */ /* override Cancel button to just raise the flag */
virtual void OnCancel(void) override { virtual void OnCancel(void) override {
/* "cancel" button or escape hit */ /* "cancel" button or escape hit */

View File

@ -34,6 +34,8 @@ public:
static void InsertBitmap(IRichEditOle* pRichEditOle, HBITMAP hBitmap); static void InsertBitmap(IRichEditOle* pRichEditOle, HBITMAP hBitmap);
private: private:
DECLARE_COPY_AND_OPEQ(CImageDataObject)
ULONG m_ulRefCnt; ULONG m_ulRefCnt;
BOOL m_bRelease; BOOL m_bRelease;

View File

@ -53,6 +53,8 @@ protected:
} }
private: private:
DECLARE_COPY_AND_OPEQ(ModelessDialog)
bool fOkayToDelete; // sanity check bool fOkayToDelete; // sanity check
}; };
@ -84,6 +86,8 @@ public:
} }
private: private:
DECLARE_COPY_AND_OPEQ(ExclusiveModelessDialog)
CWnd* fpParentWnd; CWnd* fpParentWnd;
}; };

View File

@ -58,6 +58,8 @@ protected:
virtual void UpdateBitmap(void); virtual void UpdateBitmap(void);
private: private:
DECLARE_COPY_AND_OPEQ(MyBitmapButton)
HBITMAP fhBitmap; HBITMAP fhBitmap;
int fBitmapID; int fBitmapID;

View File

@ -201,6 +201,8 @@ public:
const MyDIBitmap* pSrcBits, const RECT* pSrcRect); const MyDIBitmap* pSrcBits, const RECT* pSrcRect);
private: private:
DECLARE_COPY_AND_OPEQ(MyDIBitmap)
enum { kBMPMagic = 0x4d42 }; // "BM" enum { kBMPMagic = 0x4d42 }; // "BM"
/* for .TGA files; does not map directly to file */ /* for .TGA files; does not map directly to file */

View File

@ -43,6 +43,8 @@ public:
virtual BOOL ReplaceDlgCtrl(CDialog* pDialog, int editID); virtual BOOL ReplaceDlgCtrl(CDialog* pDialog, int editID);
private: private:
DECLARE_COPY_AND_OPEQ(MyEdit)
virtual BOOL PreTranslateMessage(MSG* pMsg) override; virtual BOOL PreTranslateMessage(MSG* pMsg) override;
bool fCapsOnly; bool fCapsOnly;

View File

@ -40,6 +40,8 @@ protected:
afx_msg void OnDeltaPos(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeltaPos(NMHDR* pNMHDR, LRESULT* pResult);
private: private:
DECLARE_COPY_AND_OPEQ(MySpinCtrl)
int fLow, fHigh; int fLow, fHigh;
/* /*

View File

@ -83,6 +83,10 @@ public:
* specifies which of the object's icons to retrieve. * specifies which of the object's icons to retrieve.
*/ */
static int GetItemIcon(LPITEMIDLIST lpi, UINT uFlags); static int GetItemIcon(LPITEMIDLIST lpi, UINT uFlags);
private:
Pidl(); // do not instantiate
~Pidl();
}; };
#endif /*UTIL_PIDL_H*/ #endif /*UTIL_PIDL_H*/

View File

@ -58,6 +58,8 @@ public:
} }
private: private:
DECLARE_COPY_AND_OPEQ(ProgressCancelDialog)
BOOL OnInitDialog(void) { BOOL OnInitDialog(void) {
CancelDialog::OnInitDialog(); CancelDialog::OnInitDialog();

View File

@ -110,6 +110,8 @@ protected:
virtual void HandleHelp() {} virtual void HandleHelp() {}
private: private:
DECLARE_COPY_AND_OPEQ(SelectFilesDialog)
/* /*
* Finishes configuring the file dialog. * Finishes configuring the file dialog.
*/ */

View File

@ -208,6 +208,9 @@ protected:
BOOL fFolderPathValid; BOOL fFolderPathValid;
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
private:
DECLARE_COPY_AND_OPEQ(ShellTree)
}; };
#endif /*UTIL_SHELLTREE_H*/ #endif /*UTIL_SHELLTREE_H*/

View File

@ -13,6 +13,7 @@
#define UTIL_SOUNDFILE_H #define UTIL_SOUNDFILE_H
#include <mmsystem.h> #include <mmsystem.h>
#include <stdint.h>
/* /*
* Class providing read-only access to uncompressed sound samples and * Class providing read-only access to uncompressed sound samples and
@ -66,6 +67,8 @@ public:
} }
private: private:
DECLARE_COPY_AND_OPEQ(SoundFile)
int SkipToHeader(uint32_t hdrID, uint32_t* pChunkLen); int SkipToHeader(uint32_t hdrID, uint32_t* pChunkLen);
enum { kWAVMinSize = 40 }; enum { kWAVMinSize = 40 };

View File

@ -35,6 +35,9 @@ public:
const char* fBuf; const char* fBuf;
long fLen; long fLen;
private:
DECLARE_COPY_AND_OPEQ(RichEditXfer)
}; };
@ -97,6 +100,9 @@ protected:
char* fWorkBuf; // work in progress char* fWorkBuf; // work in progress
long fWorkCount; // quantity of data in buffer long fWorkCount; // quantity of data in buffer
long fWorkMax; // maximum size of buffer long fWorkMax; // maximum size of buffer
private:
DECLARE_COPY_AND_OPEQ(ExpandBuffer)
}; };