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; }
private:
DECLARE_COPY_AND_OPEQ(ReformatHolder)
/*
* Utility functions.
*/
@ -427,6 +429,8 @@ public:
}
private:
DECLARE_COPY_AND_OPEQ(ReformatOutput)
/* what we're holding */
OutputKind fOutputKind;
//ReformatID fOutputID;
@ -482,8 +486,8 @@ public:
}
private:
NiftyList(void) { assert(false); }
~NiftyList(void) {}
NiftyList(void); // do not instantiate
~NiftyList(void);
/*
* Structures for holding data.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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