great copy ctor/assignment operators cleanup by Paul Cornett (patch 1307665)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-02-09 00:51:23 +00:00
parent 1906f9df59
commit f8855e4725
125 changed files with 44 additions and 892 deletions

View File

@@ -68,10 +68,6 @@ class WXDLLEXPORT wxBitmap: public wxGDIObject
public:
// Platform-specific default constructor
wxBitmap();
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
: wxGDIObject()
{ Ref(bitmap); }
// Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1);
// Initialize with XPM data
@@ -138,8 +134,6 @@ public:
int GetBitmapType() const;
inline wxBitmap& operator = (const wxBitmap& bitmap)
{ if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
inline bool operator == (const wxBitmap& bitmap) const
{ return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) const

View File

@@ -31,9 +31,6 @@ public:
wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush)
: wxBrushBase()
{ Ref(brush); }
~wxBrush();
// ------------------------------------------------------------------------
@@ -44,10 +41,6 @@ public:
virtual void SetStyle(int style) ;
virtual void SetStipple(const wxBitmap& stipple) ;
// assignment
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
// comparison
bool operator == (const wxBrush& brush) const
{ return m_refData == brush.m_refData; }

View File

@@ -40,11 +40,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public:
wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL);
@@ -56,7 +51,6 @@ public:
virtual bool Ok() const { return m_refData ; }
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
inline bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
inline bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }

View File

@@ -95,13 +95,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{
public:
// ctors and such
wxFont() { Init(); }
wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont() { }
wxFont(int size,
int family,
@@ -111,15 +105,11 @@ public:
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
Init();
(void)Create(size, family, style, weight, underlined, face, encoding);
}
wxFont(const wxNativeFontInfo& info)
{
Init();
(void)Create(info);
}
@@ -137,9 +127,6 @@ public:
virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals
virtual int GetPointSize() const;
virtual int GetFamily() const;
@@ -164,9 +151,6 @@ public:
virtual bool RealizeResource();
protected:
// common part of all ctors
void Init();
void Unshare();
private:

View File

@@ -24,10 +24,6 @@ class WXDLLEXPORT wxIcon: public wxGDIObject
public:
wxIcon();
// Copy constructors
wxIcon(const wxIcon& icon)
{ Ref(icon); }
wxIcon(const char **data) { CreateFromXpm(data); }
wxIcon(char **data) { CreateFromXpm((const char**)data); }
wxIcon(const char bits[], int width , int height );
@@ -44,8 +40,6 @@ public:
bool LoadFile(const wxString& name, wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; }
wxIcon& operator=(const wxIcon& icon)
{ if (this != &icon) Ref(icon); return *this; }
bool operator==(const wxIcon& icon) const
{ return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@@ -28,17 +28,12 @@ public:
wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen();
// wxObjectRefData
wxObjectRefData *CreateRefData() const;
wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
inline wxPen& operator = (const wxPen& pen)
{ if (*this == pen) return (*this); Ref(pen); return *this; }
inline bool operator == (const wxPen& pen) const
{ return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const