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

@@ -40,6 +40,7 @@ All:
- Fixed build error in list.h with VC++ 2005. - Fixed build error in list.h with VC++ 2005.
- Fixed wxODBC buffer overflow problem in Unicode builds. - Fixed wxODBC buffer overflow problem in Unicode builds.
- Fixed wxSocketBase::InterruptWait on wxBase. - Fixed wxSocketBase::InterruptWait on wxBase.
- Important code cleanup (Paul Cornett)
All (GUI): All (GUI):

View File

@@ -79,9 +79,6 @@ private:
class WXDLLEXPORT wxBitmapBase : public wxGDIObject class WXDLLEXPORT wxBitmapBase : public wxGDIObject
{ {
public: public:
wxBitmapBase() : wxGDIObject() {}
virtual ~wxBitmapBase() {}
/* /*
Derived class must implement these: Derived class must implement these:
@@ -90,10 +87,8 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits); wxBitmap(const char **bits);
wxBitmap(char **bits); wxBitmap(char **bits);
wxBitmap(const wxBitmap& bmp);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = -1); wxBitmap(const wxImage& image, int depth = -1);
wxBitmap& operator = (const wxBitmap& bmp);
bool operator == (const wxBitmap& bmp) const; bool operator == (const wxBitmap& bmp) const;
bool operator != (const wxBitmap& bmp) const; bool operator != (const wxBitmap& bmp) const;

View File

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

View File

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

View File

@@ -40,11 +40,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public: public:
wxCursor(); wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL); const char maskBits[] = NULL);
@@ -56,7 +51,6 @@ public:
virtual bool Ok() const { return m_refData ; } 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; }
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: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont(int size, wxFont(int size,
int family, int family,
@@ -111,15 +105,11 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
wxFont(const wxNativeFontInfo& info) wxFont(const wxNativeFontInfo& info)
{ {
Init();
(void)Create(info); (void)Create(info);
} }
@@ -137,9 +127,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;
@@ -164,9 +151,6 @@ public:
virtual bool RealizeResource(); virtual bool RealizeResource();
protected: protected:
// common part of all ctors
void Init();
void Unshare(); void Unshare();
private: private:

View File

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

View File

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

View File

@@ -23,12 +23,6 @@ public:
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
virtual ~wxAcceleratorTable(); virtual ~wxAcceleratorTable();
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable& operator=(const wxAcceleratorTable& accel)
{ if ( m_refData != accel.m_refData ) Ref(accel); return *this; }
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
bool operator==(const wxAcceleratorTable& accel) const bool operator==(const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; } { return m_refData == accel.m_refData; }

View File

@@ -35,9 +35,7 @@ class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
wxPalette(); wxPalette();
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue ); wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
wxPalette( const wxPalette& palette );
~wxPalette(); ~wxPalette();
wxPalette& operator = ( const wxPalette& palette );
bool operator == ( const wxPalette& palette ) const; bool operator == ( const wxPalette& palette ) const;
bool operator != ( const wxPalette& palette ) const; bool operator != ( const wxPalette& palette ) const;
virtual bool Ok() const; virtual bool Ok() const;

View File

@@ -35,13 +35,6 @@ public:
wxRegionGeneric(); wxRegionGeneric();
~wxRegionGeneric(); ~wxRegionGeneric();
//# Copying
wxRegionGeneric(const wxRegionGeneric& r)
: wxGDIObject()
{ Ref(r); }
wxRegionGeneric& operator= (const wxRegionGeneric& r)
{ Ref(r); return (*this); }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxRegionGeneric& region ) const; bool operator == ( const wxRegionGeneric& region ) const;

View File

@@ -71,11 +71,9 @@ public:
wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); } wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); } wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); }
~wxBitmap(); ~wxBitmap();
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp ) const; bool operator == ( const wxBitmap& bmp ) const;
bool operator != ( const wxBitmap& bmp ) const; bool operator != ( const wxBitmap& bmp ) const;
bool Ok() const; bool Ok() const;

View File

@@ -36,11 +36,6 @@ public:
wxBrush( const wxBitmap &stippleBitmap ); wxBrush( const wxBitmap &stippleBitmap );
~wxBrush(); ~wxBrush();
wxBrush( const wxBrush &brush )
: wxBrushBase()
{ Ref(brush); }
wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxBrush& brush ) const; bool operator == ( const wxBrush& brush ) const;

View File

@@ -53,12 +53,6 @@ public:
wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); } wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); }
#endif #endif
wxColour( const wxColour& col )
: wxGDIObject()
{ Ref(col); }
wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; }
~wxColour(); ~wxColour();
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }

View File

@@ -28,7 +28,6 @@ public:
wxCursor(); wxCursor();
wxCursor( int cursorId ); wxCursor( int cursorId );
wxCursor( const wxCursor &cursor );
#if wxUSE_IMAGE #if wxUSE_IMAGE
wxCursor( const wxImage & image ); wxCursor( const wxImage & image );
#endif #endif
@@ -36,7 +35,6 @@ public:
int hotSpotX=-1, int hotSpotY=-1, int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 ); const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
~wxCursor(); ~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == ( const wxCursor& cursor ) const; bool operator == ( const wxCursor& cursor ) const;
bool operator != ( const wxCursor& cursor ) const; bool operator != ( const wxCursor& cursor ) const;
bool Ok() const; bool Ok() const;

View File

@@ -29,15 +29,11 @@ class WXDLLIMPEXP_CORE wxFont;
class WXDLLIMPEXP_CORE wxFont : public wxFontBase class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{ {
public: public:
// ctors and such wxFont() { }
wxFont() { Init(); }
wxFont(const wxFont& font) : wxFontBase() { Init(); Ref(font); }
// wxGTK-specific // wxGTK-specific
wxFont(const wxString& fontname) wxFont(const wxString& fontname)
{ {
Init();
Create(fontname); Create(fontname);
} }
@@ -51,8 +47,6 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
@@ -69,9 +63,6 @@ public:
~wxFont(); ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;

View File

@@ -28,7 +28,6 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{ {
public: public:
wxIcon(); wxIcon();
wxIcon( const wxIcon& icon);
wxIcon( const char **bits, int width=-1, int height=-1 ); wxIcon( const char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to // For compatibility with wxMSW where desired size is sometimes required to
@@ -45,7 +44,6 @@ public:
{ {
} }
wxIcon& operator=(const wxIcon& icon);
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); } bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@@ -36,11 +36,6 @@ public:
wxPen( const wxColour &colour, int width = 1, int style = wxSOLID ); wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
~wxPen(); ~wxPen();
wxPen( const wxPen& pen )
: wxGDIObject()
{ Ref(pen); }
wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxPen& pen ) const; bool operator == ( const wxPen& pen ) const;

View File

@@ -80,11 +80,6 @@ public:
~wxRegion(); ~wxRegion();
wxRegion( const wxRegion& region )
: wxGDIObject()
{ Ref(region); }
wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxRegion& region ) const; bool operator == ( const wxRegion& region ) const;

View File

@@ -190,9 +190,6 @@ public:
wxImage( wxInputStream& stream, const wxString& mimetype, int index = -1 ); wxImage( wxInputStream& stream, const wxString& mimetype, int index = -1 );
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
wxImage( const wxImage& image );
wxImage( const wxImage* image );
bool Create( int width, int height, bool clear = true ); bool Create( int width, int height, bool clear = true );
bool Create( int width, int height, unsigned char* data, bool static_data = false ); bool Create( int width, int height, unsigned char* data, bool static_data = false );
bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ); bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false );
@@ -364,13 +361,6 @@ public:
// -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees // -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
void RotateHue(double angle); void RotateHue(double angle);
wxImage& operator = (const wxImage& image)
{
if ( (*this) != image )
Ref(image);
return *this;
}
bool operator == (const wxImage& image) const bool operator == (const wxImage& image) const
{ return m_refData == image.m_refData; } { return m_refData == image.m_refData; }
bool operator != (const wxImage& image) const bool operator != (const wxImage& image) const

View File

@@ -22,17 +22,8 @@ public:
wxAcceleratorTable(); wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel)
{ if (accel) Ref(*accel); }
~wxAcceleratorTable(); ~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
{ if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) const bool operator == (const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; } { return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) const bool operator != (const wxAcceleratorTable& accel) const

View File

@@ -104,13 +104,6 @@ class WXDLLEXPORT wxBitmap: public wxBitmapBase
public: public:
wxBitmap(); // Platform-specific wxBitmap(); // Platform-specific
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
: wxBitmapBase()
{
Ref(bitmap);
}
// Initialize with raw data. // Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
@@ -177,7 +170,6 @@ public:
wxMask *GetMask() const; wxMask *GetMask() const;
void SetMask(wxMask *mask) ; void SetMask(wxMask *mask) ;
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 { return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }

View File

@@ -35,9 +35,6 @@ public:
wxBrush(short macThemeBrush ) ; wxBrush(short macThemeBrush ) ;
wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple); wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush)
: wxBrushBase()
{ Ref(brush); }
~wxBrush(); ~wxBrush();
virtual void SetColour(const wxColour& col) ; virtual void SetColour(const wxColour& col) ;
@@ -47,8 +44,6 @@ public:
virtual void MacSetTheme(short macThemeBrush) ; virtual void MacSetTheme(short macThemeBrush) ;
virtual void MacSetThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ; virtual void MacSetThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
bool operator == (const wxBrush& brush) const bool operator == (const wxBrush& brush) const
{ return m_refData == brush.m_refData; } { return m_refData == brush.m_refData; }
bool operator != (const wxBrush& brush) const bool operator != (const wxBrush& brush) const

View File

@@ -39,10 +39,6 @@ public:
wxColour( const wxChar *colourName ) wxColour( const wxChar *colourName )
{ InitFromName(colourName); } { InitFromName(colourName); }
// copy ctors and assignment operators
wxColour( const wxColour& col );
wxColour& operator = ( const wxColour& col );
// dtor // dtor
~wxColour(); ~wxColour();

View File

@@ -22,11 +22,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public: public:
wxCursor(); wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL); const char maskBits[] = NULL);
@@ -42,7 +37,6 @@ public:
bool CreateFromXpm(const char **bits) ; bool CreateFromXpm(const char **bits) ;
virtual bool Ok() const ; virtual bool Ok() const ;
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; }
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

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

View File

@@ -20,13 +20,6 @@ class WXDLLEXPORT wxIcon: public wxGDIObject
public: public:
wxIcon(); wxIcon();
// Copy constructors
wxIcon(const wxIcon& icon)
: wxGDIObject()
{
Ref(icon);
}
wxIcon(const char **data); wxIcon(const char **data);
wxIcon(char **data); wxIcon(char **data);
wxIcon(const char bits[], int width , int height ); wxIcon(const char bits[], int width , int height );
@@ -43,8 +36,6 @@ public:
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE ) bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; } { 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 m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); } bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@@ -39,11 +39,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxMetafile) DECLARE_DYNAMIC_CLASS(wxMetafile)
public: public:
// Copy constructor
wxMetafile(const wxMetafile& metafile)
: wxGDIObject()
{ Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString); wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void); ~wxMetafile(void);
@@ -63,7 +58,6 @@ public:
void SetHMETAFILE(WXHMETAFILE mf) ; void SetHMETAFILE(WXHMETAFILE mf) ;
// Operators // Operators
inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; } inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; }
inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; } inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; }

View File

@@ -38,9 +38,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(); wxPalette();
wxPalette(const wxPalette& palette)
: wxPaletteBase()
{ Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(); ~wxPalette();
@@ -50,7 +47,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@@ -52,12 +52,8 @@ public:
wxPen(); wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID); wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen(); ~wxPen();
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 { return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; } inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; }

View File

@@ -54,13 +54,6 @@ public:
~wxRegion(); ~wxRegion();
//# Copying
wxRegion(const wxRegion& r)
: wxGDIObject()
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region //# Modify region
// Clear current region // Clear current region
void Clear(); void Clear();

View File

@@ -22,17 +22,8 @@ public:
wxAcceleratorTable(); wxAcceleratorTable();
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel)
{ if (accel) Ref(*accel); }
~wxAcceleratorTable(); ~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
{ if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) const bool operator == (const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; } { return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) const bool operator != (const wxAcceleratorTable& accel) const

View File

@@ -133,11 +133,6 @@ class WXDLLEXPORT wxBitmap: public wxBitmapBase
public: public:
wxBitmap(); // Platform-specific wxBitmap(); // Platform-specific
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
: wxBitmapBase()
{ Ref(bitmap); }
// Initialize with raw data. // Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
@@ -194,7 +189,6 @@ public:
int GetBitmapType() const; 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 { return m_refData == bitmap.m_refData; }
inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; } inline bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }

View File

@@ -35,9 +35,6 @@ public:
wxBrush(short macThemeBrush ) ; wxBrush(short macThemeBrush ) ;
wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple); wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush)
: wxBrushBase()
{ Ref(brush); }
~wxBrush(); ~wxBrush();
virtual void SetColour(const wxColour& col) ; virtual void SetColour(const wxColour& col) ;
@@ -47,8 +44,6 @@ public:
virtual void SetMacTheme(short macThemeBrush) ; virtual void SetMacTheme(short macThemeBrush) ;
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ; virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
bool operator == (const wxBrush& brush) const bool operator == (const wxBrush& brush) const
{ return m_refData == brush.m_refData; } { return m_refData == brush.m_refData; }
bool operator != (const wxBrush& brush) const bool operator != (const wxBrush& brush) const

View File

@@ -43,11 +43,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public: public:
wxCursor(); wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor)
: wxBitmap()
{ Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL); const char maskBits[] = NULL);
@@ -63,7 +58,6 @@ public:
bool CreateFromXpm(const char **bits) ; bool CreateFromXpm(const char **bits) ;
virtual bool Ok() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; } virtual bool Ok() const { return (m_refData != NULL && ( M_CURSORDATA->m_hCursor != NULL || M_CURSORDATA->m_themeCursor != -1 ) ) ; }
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; }
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

@@ -20,13 +20,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font)
: wxFontBase()
{
Init();
Ref(font);
}
wxFont(int size, wxFont(int size,
int family, int family,
@@ -36,15 +30,11 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
wxFont(const wxNativeFontInfo& info) wxFont(const wxNativeFontInfo& info)
{ {
Init();
(void)Create(info); (void)Create(info);
} }
@@ -62,9 +52,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;
@@ -99,9 +86,6 @@ public:
wxUint32 GetMacATSUFontID() const; wxUint32 GetMacATSUFontID() const;
protected: protected:
// common part of all ctors
void Init();
void Unshare(); void Unshare();
private: private:

View File

@@ -20,11 +20,6 @@ class WXDLLEXPORT wxIcon: public wxBitmap
public: public:
wxIcon(); wxIcon();
// Copy constructors
wxIcon(const wxIcon& icon)
: wxBitmap()
{ Ref(icon); }
wxIcon(const char **data); wxIcon(const char **data);
wxIcon(char **data); wxIcon(char **data);
wxIcon(const char bits[], int width , int height ); wxIcon(const char bits[], int width , int height );
@@ -41,8 +36,6 @@ public:
bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE ) bool LoadFile(const wxString& name ,wxBitmapType flags = wxBITMAP_TYPE_ICON_RESOURCE )
{ return LoadFile( name , flags , -1 , -1 ) ; } { 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 m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); } bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@@ -50,11 +50,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxMetafile) DECLARE_DYNAMIC_CLASS(wxMetafile)
public: public:
// Copy constructor
wxMetafile(const wxMetafile& metafile)
: wxGDIObject()
{ Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString); wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void); ~wxMetafile(void);
@@ -74,7 +69,6 @@ public:
void SetHMETAFILE(WXHMETAFILE mf) ; void SetHMETAFILE(WXHMETAFILE mf) ;
// Operators // Operators
inline wxMetafile& operator = (const wxMetafile& metafile) { if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; } inline bool operator == (const wxMetafile& metafile) const { return m_refData == metafile.m_refData; }
inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; } inline bool operator != (const wxMetafile& metafile) const { return m_refData != metafile.m_refData; }

View File

@@ -38,9 +38,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(); wxPalette();
wxPalette(const wxPalette& palette)
: wxPaletteBase()
{ Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(); ~wxPalette();
@@ -50,7 +47,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@@ -52,12 +52,8 @@ public:
wxPen(); wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID); wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen)
: wxGDIObject()
{ Ref(pen); }
~wxPen(); ~wxPen();
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 { return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; } inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; }

View File

@@ -53,13 +53,6 @@ public:
~wxRegion(); ~wxRegion();
//# Copying
wxRegion(const wxRegion& r)
: wxGDIObject()
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region //# Modify region
// Clear current region // Clear current region
void Clear(); void Clear();

View File

@@ -75,11 +75,9 @@ public:
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char **bits) { CreateFromXpm(bits); } wxBitmap(const char **bits) { CreateFromXpm(bits); }
wxBitmap(char **bits) { CreateFromXpm((const char **)bits); } wxBitmap(char **bits) { CreateFromXpm((const char **)bits); }
wxBitmap(const wxBitmap& bmp);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
wxBitmap(const wxImage& image, int depth = -1); wxBitmap(const wxImage& image, int depth = -1);
~wxBitmap() {} ~wxBitmap() {}
wxBitmap& operator = (const wxBitmap& bmp);
bool operator == (const wxBitmap& bmp) const; bool operator == (const wxBitmap& bmp) const;
bool operator != (const wxBitmap& bmp) const; bool operator != (const wxBitmap& bmp) const;
bool Ok() const; bool Ok() const;

View File

@@ -33,9 +33,7 @@ public:
wxBrush() {} wxBrush() {}
wxBrush(const wxColour &colour, int style = wxSOLID); wxBrush(const wxColour &colour, int style = wxSOLID);
wxBrush(const wxBitmap &stippleBitmap); wxBrush(const wxBitmap &stippleBitmap);
wxBrush(const wxBrush &brush);
~wxBrush() {} ~wxBrush() {}
wxBrush& operator = (const wxBrush& brush);
bool operator == (const wxBrush& brush) const; bool operator == (const wxBrush& brush) const;
bool operator != (const wxBrush& brush) const; bool operator != (const wxBrush& brush) const;
bool Ok() const; bool Ok() const;

View File

@@ -26,7 +26,6 @@ public:
wxCursor(); wxCursor();
wxCursor(int cursorId); wxCursor(int cursorId);
wxCursor(const wxCursor &cursor);
wxCursor(const char bits[], int width, int height, wxCursor(const char bits[], int width, int height,
int hotSpotX=-1, int hotSpotY=-1, int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0); const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0);
@@ -34,7 +33,6 @@ public:
long flags = wxBITMAP_TYPE_CUR_RESOURCE, long flags = wxBITMAP_TYPE_CUR_RESOURCE,
int hotSpotX = 0, int hotSpotY = 0); int hotSpotX = 0, int hotSpotY = 0);
~wxCursor(); ~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == (const wxCursor& cursor) const; bool operator == (const wxCursor& cursor) const;
bool operator != (const wxCursor& cursor) const; bool operator != (const wxCursor& cursor) const;
bool Ok() const; bool Ok() const;

View File

@@ -30,13 +30,10 @@ class WXDLLEXPORT wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont(const wxNativeFontInfo& info) wxFont(const wxNativeFontInfo& info)
{ {
Init();
(void)Create(info); (void)Create(info);
} }
@@ -48,8 +45,6 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
@@ -65,9 +60,6 @@ public:
~wxFont() {} ~wxFont() {}
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;
@@ -90,9 +82,6 @@ public:
struct font_t *GetMGLfont_t(float scale, bool antialiased); struct font_t *GetMGLfont_t(float scale, bool antialiased);
protected: protected:
// common part of all ctors
void Init() {}
// ref counting code // ref counting code
virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CreateRefData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;

View File

@@ -28,7 +28,6 @@ class WXDLLEXPORT wxIcon: public wxBitmap
{ {
public: public:
wxIcon() : wxBitmap() {} wxIcon() : wxBitmap() {}
wxIcon(const wxIcon& icon);
wxIcon(const char **bits, int width=-1, int height=-1); wxIcon(const char **bits, int width=-1, int height=-1);
wxIcon(char **bits, int width=-1, int height=-1); wxIcon(char **bits, int width=-1, int height=-1);
@@ -43,7 +42,6 @@ public:
{ {
} }
wxIcon& operator=(const wxIcon& icon);
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); } bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@@ -34,9 +34,7 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(); wxPalette();
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
wxPalette(const wxPalette& palette);
~wxPalette(); ~wxPalette();
wxPalette& operator = (const wxPalette& palette);
bool operator == (const wxPalette& palette) const; bool operator == (const wxPalette& palette) const;
bool operator != (const wxPalette& palette) const; bool operator != (const wxPalette& palette) const;
virtual bool Ok() const; virtual bool Ok() const;

View File

@@ -33,9 +33,7 @@ public:
wxPen() {} wxPen() {}
wxPen(const wxColour &colour, int width = 1, int style = wxSOLID); wxPen(const wxColour &colour, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen);
~wxPen() {} ~wxPen() {}
wxPen& operator = (const wxPen& pen);
bool operator == (const wxPen& pen) const; bool operator == (const wxPen& pen) const;
bool operator != (const wxPen& pen) const; bool operator != (const wxPen& pen) const;

View File

@@ -49,12 +49,6 @@ public:
wxRegion(); wxRegion();
~wxRegion(); ~wxRegion();
//# Copying
inline wxRegion(const wxRegion& r)
{ Ref(r); }
inline wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
//# Modify region //# Modify region
// Clear current region // Clear current region
void Clear(void); void Clear(void);

View File

@@ -23,14 +23,9 @@ public:
wxAcceleratorTable(); wxAcceleratorTable();
wxAcceleratorTable(const wxString& resource); // Load from .rc resource wxAcceleratorTable(const wxString& resource); // Load from .rc resource
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
~wxAcceleratorTable(); ~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; } bool operator == (const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; } bool operator != (const wxAcceleratorTable& accel) const { return m_refData != accel.m_refData; }

View File

@@ -24,10 +24,7 @@ class WXDLLEXPORT wxCursor: public wxObject
public: public:
wxCursor(); wxCursor();
// Copy constructors
wxCursor(const wxCursor& cursor) { Ref(cursor); }
wxCursor(const char bits[], int width, int height, wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL); const char maskBits[] = NULL);
@@ -44,8 +41,6 @@ public:
virtual bool Ok() const; virtual bool Ok() const;
wxCursor& operator = (const wxCursor& cursor)
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator == (const wxCursor& cursor) const bool operator == (const wxCursor& cursor) const
{ return m_refData == cursor.m_refData; } { return m_refData == cursor.m_refData; }
bool operator != (const wxCursor& cursor) const bool operator != (const wxCursor& cursor) const

View File

@@ -27,8 +27,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont(int size, wxFont(int size,
int family, int family,
@@ -38,8 +37,6 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
@@ -60,9 +57,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;
@@ -120,9 +114,6 @@ public:
protected: protected:
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
// common part of all ctors
void Init();
void Unshare(); void Unshare();
private: private:

View File

@@ -20,9 +20,6 @@ class WXDLLEXPORT wxIcon : public wxBitmap
public: public:
wxIcon(); wxIcon();
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
// Initialize with XBM data // Initialize with XBM data
wxIcon(const char bits[], int width, int height); wxIcon(const char bits[], int width, int height);
@@ -58,8 +55,6 @@ public:
// ctors, assignment operators...), but it's ok to have such function // ctors, assignment operators...), but it's ok to have such function
void CopyFromBitmap(const wxBitmap& bmp); void CopyFromBitmap(const wxBitmap& bmp);
wxIcon& operator = (const wxIcon& icon)
{ if (this != &icon) Ref(icon); return *this; }
bool operator == (const wxIcon& icon) const bool operator == (const wxIcon& icon) const
{ return m_refData == icon.m_refData; } { return m_refData == icon.m_refData; }
bool operator != (const wxIcon& icon) const bool operator != (const wxIcon& icon) const

View File

@@ -51,7 +51,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(); wxPalette();
wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(); ~wxPalette();
@@ -61,7 +60,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@@ -20,10 +20,7 @@ class WXDLLEXPORT wxAcceleratorTable : public wxObject
{ {
public: public:
// default ctor // default ctor
wxAcceleratorTable() : wxObject() { } wxAcceleratorTable() { }
// copy ctor
wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject(accel) { Ref(accel); }
// load from .rc resource (Windows specific) // load from .rc resource (Windows specific)
wxAcceleratorTable(const wxString& resource); wxAcceleratorTable(const wxString& resource);
@@ -31,13 +28,6 @@ public:
// initialize from array // initialize from array
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
wxAcceleratorTable& operator=(const wxAcceleratorTable& accel)
{
if ( *this != accel )
Ref(accel);
return *this;
}
bool operator==(const wxAcceleratorTable& accel) const; bool operator==(const wxAcceleratorTable& accel) const;
bool operator!=(const wxAcceleratorTable& accel) const bool operator!=(const wxAcceleratorTable& accel) const
{ return !(*this == accel); } { return !(*this == accel); }

View File

@@ -39,10 +39,7 @@ class WXDLLEXPORT wxBitmap : public wxGDIImage
{ {
public: public:
// default ctor creates an invalid bitmap, you must Create() it later // default ctor creates an invalid bitmap, you must Create() it later
wxBitmap() { Init(); } wxBitmap() { }
// Copy constructors
wxBitmap(const wxBitmap& bitmap) : wxGDIImage(bitmap) { Init(); Ref(bitmap); }
// Initialize with raw data // Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
@@ -79,14 +76,7 @@ public:
// we must have this, otherwise icons are silently copied into bitmaps using // we must have this, otherwise icons are silently copied into bitmaps using
// the copy ctor but the resulting bitmap is invalid! // the copy ctor but the resulting bitmap is invalid!
wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); } wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
wxBitmap& operator=(const wxBitmap& bitmap)
{
if ( m_refData != bitmap.m_refData )
Ref(bitmap);
return *this;
}
wxBitmap& operator=(const wxIcon& icon) wxBitmap& operator=(const wxIcon& icon)
{ {
@@ -172,9 +162,6 @@ public:
#endif // __WXDEBUG__ #endif // __WXDEBUG__
protected: protected:
// common part of all ctors
void Init();
virtual wxGDIImageRefData *CreateData() const; virtual wxGDIImageRefData *CreateData() const;
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;

View File

@@ -28,7 +28,6 @@ public:
wxBrush(); wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple); wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush) : wxBrushBase(brush) { Ref(brush); }
virtual ~wxBrush(); virtual ~wxBrush();
virtual void SetColour(const wxColour& col); virtual void SetColour(const wxColour& col);
@@ -36,7 +35,6 @@ public:
virtual void SetStyle(int style); virtual void SetStyle(int style);
virtual void SetStipple(const wxBitmap& stipple); virtual void SetStipple(const wxBitmap& stipple);
wxBrush& operator=(const wxBrush& brush);
bool operator==(const wxBrush& brush) const; bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); } bool operator!=(const wxBrush& brush) const { return !(*this == brush); }

View File

@@ -38,11 +38,6 @@ public:
wxColour(const wxString &colourName) { InitFromName(colourName); } wxColour(const wxString &colourName) { InitFromName(colourName); }
wxColour(const wxChar *colourName) { InitFromName(colourName); } wxColour(const wxChar *colourName) { InitFromName(colourName); }
// copy ctors and assignment operators
wxColour(const wxColour& col);
wxColour& operator=( const wxColour& col);
// dtor // dtor
~wxColour(); ~wxColour();

View File

@@ -22,7 +22,6 @@ class WXDLLEXPORT wxCursor : public wxGDIImage
public: public:
// constructors // constructors
wxCursor(); wxCursor();
wxCursor(const wxCursor& cursor) : wxGDIImage(cursor) { Ref(cursor); }
wxCursor(const wxImage& image); wxCursor(const wxImage& image);
wxCursor(const char bits[], int width, int height, wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1, int hotSpotX = -1, int hotSpotY = -1,
@@ -33,9 +32,6 @@ public:
wxCursor(int idCursor); wxCursor(int idCursor);
virtual ~wxCursor(); virtual ~wxCursor();
wxCursor& operator=(const wxCursor& cursor)
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator==(const wxCursor& cursor) const; bool operator==(const wxCursor& cursor) const;
bool operator!=(const wxCursor& cursor) const bool operator!=(const wxCursor& cursor) const
{ return !(*this == cursor); } { return !(*this == cursor); }

View File

@@ -22,8 +22,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
wxFont(int size, wxFont(int size,
int family, int family,
@@ -33,8 +32,6 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
@@ -46,16 +43,12 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(pixelSize, family, style, weight, (void)Create(pixelSize, family, style, weight,
underlined, face, encoding); underlined, face, encoding);
} }
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0) wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{ {
Init();
Create(info, hFont); Create(info, hFont);
} }
@@ -89,9 +82,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const; virtual wxSize GetPixelSize() const;
@@ -145,9 +135,6 @@ protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
// common part of all ctors
void Init();
void Unshare(); void Unshare();
private: private:

View File

@@ -44,9 +44,6 @@ public:
// default // default
wxIcon() { } wxIcon() { }
// copy
wxIcon(const wxIcon& icon) : wxGDIImage(icon) { Ref(icon); }
// from raw data // from raw data
wxIcon(const char bits[], int width, int height); wxIcon(const char bits[], int width, int height);
@@ -68,8 +65,6 @@ public:
long type = wxBITMAP_TYPE_ICO_RESOURCE, long type = wxBITMAP_TYPE_ICO_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1); int desiredWidth = -1, int desiredHeight = -1);
wxIcon& operator = (const wxIcon& icon)
{ if ( *this != icon ) Ref(icon); return *this; }
bool operator == (const wxIcon& icon) const bool operator == (const wxIcon& icon) const
{ return m_refData == icon.m_refData; } { return m_refData == icon.m_refData; }
bool operator != (const wxIcon& icon) const bool operator != (const wxIcon& icon) const

View File

@@ -44,7 +44,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{ {
public: public:
wxMetafile(const wxString& file = wxEmptyString); wxMetafile(const wxString& file = wxEmptyString);
wxMetafile(const wxMetafile& metafile) { Ref(metafile); }
virtual ~wxMetafile(); virtual ~wxMetafile();
// After this is called, the metafile cannot be used for anything // After this is called, the metafile cannot be used for anything
@@ -69,8 +68,6 @@ public:
void SetWindowsMappingMode(int mm); void SetWindowsMappingMode(int mm);
// Operators // Operators
wxMetafile& operator=(const wxMetafile& metafile)
{ if (*this != metafile) Ref(metafile); return *this; }
bool operator==(const wxMetafile& metafile) const bool operator==(const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; } { return m_refData == metafile.m_refData; }
bool operator!=(const wxMetafile& metafile) const bool operator!=(const wxMetafile& metafile) const

View File

@@ -34,7 +34,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(void); wxPalette(void);
inline wxPalette(const wxPalette& palette) : wxPaletteBase(palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(void); ~wxPalette(void);
@@ -44,7 +43,6 @@ public:
virtual bool Ok(void) const { return (m_refData != NULL) ; } virtual bool Ok(void) const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@@ -77,17 +77,8 @@ public:
wxPen(); wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID); wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen) : wxGDIObject(pen) { Ref(pen); }
virtual ~wxPen(); virtual ~wxPen();
wxPen& operator=(const wxPen& pen)
{
if ( this != &pen )
Ref(pen);
return *this;
}
bool operator==(const wxPen& pen) const bool operator==(const wxPen& pen) const
{ {
const wxPenRefData *penData = (wxPenRefData *)pen.m_refData; const wxPenRefData *penData = (wxPenRefData *)pen.m_refData;

View File

@@ -56,12 +56,6 @@ public:
virtual ~wxRegion(); virtual ~wxRegion();
// Copying
wxRegion(const wxRegion& r) : wxGDIObject(r)
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
// Modify region // Modify region
// ------------- // -------------

View File

@@ -380,6 +380,24 @@ inline void* wxCheckCast(void *ptr)
#endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING #endif // __WXDEBUG__ && wxUSE_MEMORY_TRACING
// ----------------------------------------------------------------------------
// wxObjectRefData: ref counted data meant to be stored in wxObject
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxObjectRefData
{
friend class WXDLLIMPEXP_BASE wxObject;
public:
wxObjectRefData() : m_count(1) { }
virtual ~wxObjectRefData() { }
int GetRefCount() const { return m_count; }
private:
int m_count;
};
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxObject: the root class of wxWidgets object hierarchy // wxObject: the root class of wxWidgets object hierarchy
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -388,24 +406,22 @@ class WXDLLIMPEXP_BASE wxObject
{ {
DECLARE_ABSTRACT_CLASS(wxObject) DECLARE_ABSTRACT_CLASS(wxObject)
private:
void InitFrom(const wxObject& other);
public: public:
wxObject() { m_refData = NULL; } wxObject() { m_refData = NULL; }
virtual ~wxObject() { UnRef(); } virtual ~wxObject() { UnRef(); }
wxObject(const wxObject& other) wxObject(const wxObject& other)
{ {
InitFrom(other); m_refData = other.m_refData;
if (m_refData)
m_refData->m_count++;
} }
wxObject& operator=(const wxObject& other) wxObject& operator=(const wxObject& other)
{ {
if ( this != &other ) if ( this != &other )
{ {
UnRef(); Ref(other);
InitFrom(other);
} }
return *this; return *this;
} }
@@ -485,25 +501,6 @@ protected:
wxObjectRefData *m_refData; wxObjectRefData *m_refData;
}; };
// ----------------------------------------------------------------------------
// wxObjectRefData: ref counted data meant to be stored in wxObject
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxObjectRefData
{
friend class WXDLLIMPEXP_BASE wxObject;
public:
wxObjectRefData() : m_count(1) { }
virtual ~wxObjectRefData() { }
int GetRefCount() const { return m_count; }
private:
int m_count;
};
inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo) inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
{ {
return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL; return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL;

View File

@@ -38,14 +38,8 @@ public:
,const wxAcceleratorEntry vaEntries[] ,const wxAcceleratorEntry vaEntries[]
); // Load from array ); // Load from array
// Copy constructors
inline wxAcceleratorTable(const wxAcceleratorTable& rAccel) { Ref(rAccel); }
inline wxAcceleratorTable(const wxAcceleratorTable* pAccel) { if (pAccel) Ref(*pAccel); }
~wxAcceleratorTable(); ~wxAcceleratorTable();
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& rAccel)
{ if (*this == rAccel) return (*this); Ref(rAccel); return *this; };
inline bool operator== (const wxAcceleratorTable& rAccel) const inline bool operator== (const wxAcceleratorTable& rAccel) const
{ return m_refData == rAccel.m_refData; }; { return m_refData == rAccel.m_refData; };
inline bool operator!= (const wxAcceleratorTable& rAccel) const inline bool operator!= (const wxAcceleratorTable& rAccel) const

View File

@@ -70,7 +70,11 @@ public:
// Copy constructors // Copy constructors
inline wxBitmap(const wxBitmap& rBitmap) inline wxBitmap(const wxBitmap& rBitmap)
{ Init(); Ref(rBitmap); SetHandle(rBitmap.GetHandle()); } : wxGDIImage(rBitmap)
{
Init();
SetHandle(rBitmap.GetHandle());
}
// Initialize with raw data // Initialize with raw data
wxBitmap( const char bits[] wxBitmap( const char bits[]
@@ -112,13 +116,6 @@ public:
inline wxBitmap(const wxIcon& rIcon) inline wxBitmap(const wxIcon& rIcon)
{ Init(); CopyFromIcon(rIcon); } { Init(); CopyFromIcon(rIcon); }
wxBitmap& operator=(const wxBitmap& rBitmap)
{
if ( m_refData != rBitmap.m_refData )
Ref(rBitmap);
return(*this);
}
wxBitmap& operator=(const wxIcon& rIcon) wxBitmap& operator=(const wxIcon& rIcon)
{ {
(void)CopyFromIcon(rIcon); (void)CopyFromIcon(rIcon);

View File

@@ -45,10 +45,8 @@ public:
wxBrush(); wxBrush();
wxBrush(const wxColour& rCol, int nStyle = wxSOLID); wxBrush(const wxColour& rCol, int nStyle = wxSOLID);
wxBrush(const wxBitmap& rStipple); wxBrush(const wxBitmap& rStipple);
inline wxBrush(const wxBrush& rBrush) { Ref(rBrush); }
~wxBrush(); ~wxBrush();
inline wxBrush& operator = (const wxBrush& rBrush) { if (*this == rBrush) return (*this); Ref(rBrush); return *this; }
inline bool operator == (const wxBrush& rBrush) const { return m_refData == rBrush.m_refData; } inline bool operator == (const wxBrush& rBrush) const { return m_refData == rBrush.m_refData; }
inline bool operator != (const wxBrush& rBrush) const { return m_refData != rBrush.m_refData; } inline bool operator != (const wxBrush& rBrush) const { return m_refData != rBrush.m_refData; }

View File

@@ -32,8 +32,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap
public: public:
wxCursor(); wxCursor();
// Copy constructors
wxCursor(const wxCursor& rCursor) { Ref(rCursor); }
wxCursor(const wxImage& rImage); wxCursor(const wxImage& rImage);
wxCursor( const char acBits[] wxCursor( const char acBits[]
@@ -50,14 +48,6 @@ public:
); );
wxCursor(int nCursorType); wxCursor(int nCursorType);
inline ~wxCursor() { } inline ~wxCursor() { }
inline wxCursor& operator = (const wxCursor& rCursor)
{
if (*this == rCursor)
return (*this);
Ref(rCursor);
return *this;
}
inline bool operator == (const wxCursor& rCursor) const { return m_refData == rCursor.m_refData; } inline bool operator == (const wxCursor& rCursor) const { return m_refData == rCursor.m_refData; }
inline bool operator != (const wxCursor& rCursor) const { return m_refData != rCursor.m_refData; } inline bool operator != (const wxCursor& rCursor) const { return m_refData != rCursor.m_refData; }

View File

@@ -25,8 +25,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& rFont) { Init(); Ref(rFont); }
wxFont( int nSize wxFont( int nSize
,int nFamily ,int nFamily
@@ -37,8 +36,6 @@ public:
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
) )
{ {
Init();
(void)Create( nSize (void)Create( nSize
,nFamily ,nFamily
,nStyle ,nStyle
@@ -54,8 +51,6 @@ public:
) )
{ {
Init();
(void)Create( rInfo (void)Create( rInfo
,hFont ,hFont
); );
@@ -77,11 +72,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
//
// Assignment
//
wxFont& operator=(const wxFont& rFont);
// //
// Implement base class pure virtuals // Implement base class pure virtuals
// //
@@ -123,10 +113,6 @@ public:
protected: protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& rInfo); virtual void DoSetNativeFontInfo(const wxNativeFontInfo& rInfo);
//
// Common part of all ctors
//
void Init(void);
void Unshare(void); void Unshare(void);
private: private:

View File

@@ -40,9 +40,6 @@ class WXDLLEXPORT wxIcon: public wxIconBase
public: public:
wxIcon(); wxIcon();
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
wxIcon( const char bits[] wxIcon( const char bits[]
,int nWidth ,int nWidth
,int nHeight ,int nHeight
@@ -67,8 +64,6 @@ public:
,int nDesiredHeight = -1 ,int nDesiredHeight = -1
); );
inline wxIcon& operator = (const wxIcon& rIcon)
{ if (*this != rIcon) Ref(rIcon); return *this; }
inline bool operator == (const wxIcon& rIcon) const inline bool operator == (const wxIcon& rIcon) const
{ return m_refData == rIcon.m_refData; } { return m_refData == rIcon.m_refData; }
inline bool operator != (const wxIcon& rIcon) const inline bool operator != (const wxIcon& rIcon) const

View File

@@ -50,10 +50,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxMetafile) DECLARE_DYNAMIC_CLASS(wxMetafile)
public: public:
// Copy constructor
inline wxMetafile(const wxMetafile& metafile)
{ Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString); wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void); ~wxMetafile(void);
@@ -71,8 +67,6 @@ public:
void SetWindowsMappingMode(int mm); void SetWindowsMappingMode(int mm);
// Operators // Operators
inline wxMetafile& operator = (const wxMetafile& metafile)
{ if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator== (const wxMetafile& metafile) const inline bool operator== (const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; } { return m_refData == metafile.m_refData; }
inline bool operator!= (const wxMetafile& metafile) const inline bool operator!= (const wxMetafile& metafile) const

View File

@@ -36,7 +36,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(); wxPalette();
inline wxPalette(const wxPalette& rPalette) { Ref(rPalette); }
wxPalette( int n wxPalette( int n
,const unsigned char* pRed ,const unsigned char* pRed
@@ -62,7 +61,6 @@ public:
virtual bool Ok(void) const { return (m_refData != NULL) ; } virtual bool Ok(void) const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& rPalette) { if (*this == rPalette) return (*this); Ref(rPalette); return *this; }
inline bool operator == (const wxPalette& rPalette) const inline bool operator == (const wxPalette& rPalette) const
{ return m_refData == rPalette.m_refData; } { return m_refData == rPalette.m_refData; }
inline bool operator != (const wxPalette& rPalette) const inline bool operator != (const wxPalette& rPalette) const

View File

@@ -52,11 +52,8 @@ public:
wxPen( const wxBitmap& rStipple wxPen( const wxBitmap& rStipple
,int nWidth ,int nWidth
); );
inline wxPen(const wxPen& rPen) { Ref(rPen); }
~wxPen(); ~wxPen();
inline wxPen& operator = (const wxPen& rPen)
{ if (*this == rPen) return (*this); Ref(rPen); return *this; }
inline bool operator == (const wxPen& rPen) const inline bool operator == (const wxPen& rPen) const
{ return m_refData == rPen.m_refData; } { return m_refData == rPen.m_refData; }
inline bool operator != (const wxPen& rPen) const inline bool operator != (const wxPen& rPen) const

View File

@@ -59,14 +59,6 @@ public:
wxRegion(); wxRegion();
~wxRegion(); ~wxRegion();
//
// Copying
//
inline wxRegion(const wxRegion& rSrc)
{ Ref(rSrc); }
inline wxRegion& operator = (const wxRegion& rSrc)
{ Ref(rSrc); return (*this); }
// //
// Modify region // Modify region
// //

View File

@@ -22,9 +22,6 @@ public:
// default ctor // default ctor
wxAcceleratorTable(); wxAcceleratorTable();
// copy ctor
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
// load from .rc resource (Windows specific) // load from .rc resource (Windows specific)
wxAcceleratorTable(const wxString& resource); wxAcceleratorTable(const wxString& resource);
@@ -33,8 +30,6 @@ public:
virtual ~wxAcceleratorTable(); virtual ~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; }
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
bool operator==(const wxAcceleratorTable& accel) const bool operator==(const wxAcceleratorTable& accel) const
{ return m_refData == accel.m_refData; } { return m_refData == accel.m_refData; }

View File

@@ -41,9 +41,6 @@ public:
// default ctor creates an invalid bitmap, you must Create() it later // default ctor creates an invalid bitmap, you must Create() it later
wxBitmap() { Init(); } wxBitmap() { Init(); }
// Copy constructors
wxBitmap(const wxBitmap& bitmap) { Init(); Ref(bitmap); }
// Initialize with raw data // Initialize with raw data
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
@@ -81,13 +78,6 @@ public:
// the copy ctor but the resulting bitmap is invalid! // the copy ctor but the resulting bitmap is invalid!
wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); } wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); }
wxBitmap& operator=(const wxBitmap& bitmap)
{
if ( m_refData != bitmap.m_refData )
Ref(bitmap);
return *this;
}
wxBitmap& operator=(const wxIcon& icon) wxBitmap& operator=(const wxIcon& icon)
{ {
(void)CopyFromIcon(icon); (void)CopyFromIcon(icon);

View File

@@ -28,7 +28,6 @@ public:
wxBrush(); wxBrush();
wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxColour& col, int style = wxSOLID);
wxBrush(const wxBitmap& stipple); wxBrush(const wxBitmap& stipple);
wxBrush(const wxBrush& brush) { Ref(brush); }
virtual ~wxBrush(); virtual ~wxBrush();
virtual void SetColour(const wxColour& col); virtual void SetColour(const wxColour& col);
@@ -36,7 +35,6 @@ public:
virtual void SetStyle(int style); virtual void SetStyle(int style);
virtual void SetStipple(const wxBitmap& stipple); virtual void SetStipple(const wxBitmap& stipple);
wxBrush& operator=(const wxBrush& brush);
bool operator==(const wxBrush& brush) const; bool operator==(const wxBrush& brush) const;
bool operator!=(const wxBrush& brush) const { return !(*this == brush); } bool operator!=(const wxBrush& brush) const { return !(*this == brush); }

View File

@@ -22,7 +22,6 @@ class WXDLLEXPORT wxCursor : public wxGDIImage
public: public:
// constructors // constructors
wxCursor(); wxCursor();
wxCursor(const wxCursor& cursor) { Ref(cursor); }
wxCursor(const wxImage& image); wxCursor(const wxImage& image);
wxCursor(const char bits[], int width, int height, wxCursor(const char bits[], int width, int height,
int hotSpotX = -1, int hotSpotY = -1, int hotSpotX = -1, int hotSpotY = -1,
@@ -33,9 +32,6 @@ public:
wxCursor(int idCursor); wxCursor(int idCursor);
virtual ~wxCursor(); virtual ~wxCursor();
wxCursor& operator=(const wxCursor& cursor)
{ if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator==(const wxCursor& cursor) const; bool operator==(const wxCursor& cursor) const;
bool operator!=(const wxCursor& cursor) const bool operator!=(const wxCursor& cursor) const
{ return !(*this == cursor); } { return !(*this == cursor); }

View File

@@ -22,8 +22,7 @@ class WXDLLEXPORT wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); }
wxFont(int size, wxFont(int size,
int family, int family,
@@ -33,8 +32,6 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
@@ -46,16 +43,12 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(pixelSize, family, style, weight, (void)Create(pixelSize, family, style, weight,
underlined, face, encoding); underlined, face, encoding);
} }
wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0) wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{ {
Init();
Create(info, hFont); Create(info, hFont);
} }
@@ -89,9 +82,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual wxSize GetPixelSize() const; virtual wxSize GetPixelSize() const;
@@ -137,9 +127,6 @@ protected:
virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info);
// common part of all ctors
void Init();
void Unshare(); void Unshare();
private: private:

View File

@@ -44,9 +44,6 @@ public:
// default // default
wxIcon() { } wxIcon() { }
// copy
wxIcon(const wxIcon& icon) { Ref(icon); }
// from raw data // from raw data
wxIcon(const char bits[], int width, int height); wxIcon(const char bits[], int width, int height);
@@ -68,8 +65,6 @@ public:
long type = wxBITMAP_TYPE_ICO_RESOURCE, long type = wxBITMAP_TYPE_ICO_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1); int desiredWidth = -1, int desiredHeight = -1);
wxIcon& operator = (const wxIcon& icon)
{ if ( *this != icon ) Ref(icon); return *this; }
bool operator == (const wxIcon& icon) const bool operator == (const wxIcon& icon) const
{ return m_refData == icon.m_refData; } { return m_refData == icon.m_refData; }
bool operator != (const wxIcon& icon) const bool operator != (const wxIcon& icon) const

View File

@@ -44,7 +44,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject
{ {
public: public:
wxMetafile(const wxString& file = wxEmptyString); wxMetafile(const wxString& file = wxEmptyString);
wxMetafile(const wxMetafile& metafile) { Ref(metafile); }
virtual ~wxMetafile(); virtual ~wxMetafile();
// After this is called, the metafile cannot be used for anything // After this is called, the metafile cannot be used for anything
@@ -69,8 +68,6 @@ public:
void SetWindowsMappingMode(int mm); void SetWindowsMappingMode(int mm);
// Operators // Operators
wxMetafile& operator=(const wxMetafile& metafile)
{ if (*this != metafile) Ref(metafile); return *this; }
bool operator==(const wxMetafile& metafile) const bool operator==(const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; } { return m_refData == metafile.m_refData; }
bool operator!=(const wxMetafile& metafile) const bool operator!=(const wxMetafile& metafile) const

View File

@@ -34,7 +34,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(void); wxPalette(void);
inline wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(void); ~wxPalette(void);
@@ -44,7 +43,6 @@ public:
virtual bool Ok(void) const { return (m_refData != NULL) ; } virtual bool Ok(void) const { return (m_refData != NULL) ; }
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } inline bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } inline bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@@ -77,17 +77,8 @@ public:
wxPen(); wxPen();
wxPen(const wxColour& col, int width = 1, int style = wxSOLID); wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
wxPen(const wxPen& pen) { Ref(pen); }
virtual ~wxPen(); virtual ~wxPen();
wxPen& operator=(const wxPen& pen)
{
if ( this != &pen )
Ref(pen);
return *this;
}
bool operator==(const wxPen& pen) const bool operator==(const wxPen& pen) const
{ {
const wxPenRefData *penData = (wxPenRefData *)pen.m_refData; const wxPenRefData *penData = (wxPenRefData *)pen.m_refData;

View File

@@ -56,12 +56,6 @@ public:
virtual ~wxRegion(); virtual ~wxRegion();
// Copying
wxRegion(const wxRegion& r) : wxGDIObject(r)
{ Ref(r); }
wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); }
// Modify region // Modify region
// ------------- // -------------

View File

@@ -78,11 +78,9 @@ public:
wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char bits[], int width, int height, int depth = 1 );
wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); }
wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); } wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); }
wxBitmap( const wxBitmap& bmp );
wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM );
virtual ~wxBitmap(); virtual ~wxBitmap();
wxBitmap& operator = ( const wxBitmap& bmp );
bool operator == ( const wxBitmap& bmp ) const; bool operator == ( const wxBitmap& bmp ) const;
bool operator != ( const wxBitmap& bmp ) const; bool operator != ( const wxBitmap& bmp ) const;
bool Ok() const; bool Ok() const;

View File

@@ -35,9 +35,6 @@ public:
wxBrush( const wxBitmap &stippleBitmap ); wxBrush( const wxBitmap &stippleBitmap );
~wxBrush(); ~wxBrush();
wxBrush( const wxBrush &brush ) { Ref(brush); }
wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxBrush& brush ) const; bool operator == ( const wxBrush& brush ) const;

View File

@@ -58,9 +58,6 @@ public:
// Get colour from name or wxNullColour // Get colour from name or wxNullColour
static wxColour CreateByName(const wxString& name); static wxColour CreateByName(const wxString& name);
wxColour( const wxColour& col ) { Ref(col); }
wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; }
~wxColour(); ~wxColour();
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }

View File

@@ -28,7 +28,6 @@ public:
wxCursor(); wxCursor();
wxCursor( int cursorId ); wxCursor( int cursorId );
wxCursor( const wxCursor &cursor );
#if wxUSE_IMAGE #if wxUSE_IMAGE
wxCursor( const wxImage & image ); wxCursor( const wxImage & image );
#endif #endif
@@ -36,7 +35,6 @@ public:
int hotSpotX=-1, int hotSpotY=-1, int hotSpotX=-1, int hotSpotY=-1,
const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 ); const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 );
~wxCursor(); ~wxCursor();
wxCursor& operator = ( const wxCursor& cursor );
bool operator == ( const wxCursor& cursor ) const; bool operator == ( const wxCursor& cursor ) const;
bool operator != ( const wxCursor& cursor ) const; bool operator != ( const wxCursor& cursor ) const;
bool Ok() const; bool Ok() const;

View File

@@ -19,8 +19,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase
{ {
public: public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { }
wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont(int size, wxFont(int size,
int family, int family,
@@ -30,8 +29,6 @@ public:
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
@@ -56,9 +53,6 @@ public:
virtual ~wxFont(); virtual ~wxFont();
// assignment
wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;
@@ -109,9 +103,6 @@ public:
protected: protected:
virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info );
// common part of all ctors
void Init();
void Unshare(); void Unshare();
private: private:

View File

@@ -22,7 +22,6 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
{ {
public: public:
wxIcon(); wxIcon();
wxIcon( const wxIcon& icon);
wxIcon( const char **bits, int width=-1, int height=-1 ); wxIcon( const char **bits, int width=-1, int height=-1 );
// For compatibility with wxMSW where desired size is sometimes required to // For compatibility with wxMSW where desired size is sometimes required to
@@ -39,7 +38,6 @@ public:
{ {
} }
wxIcon& operator=(const wxIcon& icon);
bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; } bool operator==(const wxIcon& icon) const { return m_refData == icon.m_refData; }
bool operator!=(const wxIcon& icon) const { return !(*this == icon); } bool operator!=(const wxIcon& icon) const { return !(*this == icon); }

View File

@@ -51,7 +51,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase
public: public:
wxPalette(); wxPalette();
wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(); ~wxPalette();
@@ -61,7 +60,6 @@ public:
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }

View File

@@ -38,9 +38,6 @@ public:
wxPen( const wxBitmap &stipple, int width ); wxPen( const wxBitmap &stipple, int width );
~wxPen(); ~wxPen();
wxPen( const wxPen& pen ) { Ref(pen); }
wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxPen& pen ) const; bool operator == ( const wxPen& pen ) const;

View File

@@ -82,9 +82,6 @@ public:
~wxRegion(); ~wxRegion();
wxRegion( const wxRegion& region ) { Ref(region); }
wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; }
bool Ok() const { return m_refData != NULL; } bool Ok() const { return m_refData != NULL; }
bool operator == ( const wxRegion& region ) const; bool operator == ( const wxRegion& region ) const;

View File

@@ -32,10 +32,6 @@ wxFontRefData::~wxFontRefData()
// TODO: delete font data // TODO: delete font data
} }
void wxFont::Init()
{
}
bool wxFont::Create(const wxNativeFontInfo&) bool wxFont::Create(const wxNativeFontInfo&)
{ {
return FALSE; return FALSE;

View File

@@ -300,14 +300,6 @@ void wxFontBase::SetNativeFontInfoUserDesc(const wxString& info)
} }
} }
wxFont& wxFont::operator=(const wxFont& font)
{
if ( this != &font )
Ref(font);
return (wxFont &)*this;
}
bool wxFontBase::operator==(const wxFont& font) const bool wxFontBase::operator==(const wxFont& font) const
{ {
// either it is the same font, i.e. they share the same common data or they // either it is the same font, i.e. they share the same common data or they

View File

@@ -148,17 +148,6 @@ wxImage::wxImage( wxInputStream& stream, const wxString& mimetype, int index )
} }
#endif // wxUSE_STREAMS #endif // wxUSE_STREAMS
wxImage::wxImage( const wxImage& image )
: wxObject()
{
Ref(image);
}
wxImage::wxImage( const wxImage* image )
{
if (image) Ref(*image);
}
wxImage::wxImage( const char** xpmData ) wxImage::wxImage( const char** xpmData )
{ {
Create(xpmData); Create(xpmData);

View File

@@ -283,15 +283,6 @@ wxObject *wxCreateDynamicObject(const wxChar *name)
// wxObject // wxObject
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Initialize ref data from another object (needed for copy constructor and
// assignment operator)
void wxObject::InitFrom(const wxObject& other)
{
m_refData = other.m_refData;
if ( m_refData )
m_refData->m_count++;
}
void wxObject::Ref(const wxObject& clone) void wxObject::Ref(const wxObject& clone)
{ {
#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT #if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT

View File

@@ -66,23 +66,10 @@ wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green
Create(n, red, green, blue); Create(n, red, green, blue);
} }
wxPalette::wxPalette(const wxPalette& palette)
: wxPaletteBase()
{
Ref(palette);
}
wxPalette::~wxPalette() wxPalette::~wxPalette()
{ {
} }
wxPalette& wxPalette::operator = (const wxPalette& palette)
{
if (*this == palette) return (*this);
Ref(palette);
return *this;
}
bool wxPalette::operator == (const wxPalette& palette) const bool wxPalette::operator == (const wxPalette& palette) const
{ {
return m_refData == palette.m_refData; return m_refData == palette.m_refData;

Some files were not shown because too many files have changed in this diff Show More