From f8855e47254a28f5141524b3aaaac03c2944e997 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 9 Feb 2006 00:51:23 +0000 Subject: [PATCH] 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 --- docs/changes.txt | 1 + include/wx/bitmap.h | 5 ---- include/wx/cocoa/bitmap.h | 6 ---- include/wx/cocoa/brush.h | 7 ----- include/wx/cocoa/cursor.h | 6 ---- include/wx/cocoa/font.h | 18 +----------- include/wx/cocoa/icon.h | 6 ---- include/wx/cocoa/pen.h | 5 ---- include/wx/generic/accel.h | 6 ---- include/wx/generic/paletteg.h | 2 -- include/wx/generic/region.h | 7 ----- include/wx/gtk/bitmap.h | 2 -- include/wx/gtk/brush.h | 5 ---- include/wx/gtk/colour.h | 6 ---- include/wx/gtk/cursor.h | 2 -- include/wx/gtk/font.h | 11 +------- include/wx/gtk/icon.h | 2 -- include/wx/gtk/pen.h | 5 ---- include/wx/gtk/region.h | 5 ---- include/wx/image.h | 10 ------- include/wx/mac/carbon/accel.h | 9 ------ include/wx/mac/carbon/bitmap.h | 8 ------ include/wx/mac/carbon/brush.h | 5 ---- include/wx/mac/carbon/colour.h | 4 --- include/wx/mac/carbon/cursor.h | 6 ---- include/wx/mac/carbon/font.h | 18 +----------- include/wx/mac/carbon/icon.h | 9 ------ include/wx/mac/carbon/metafile.h | 6 ---- include/wx/mac/carbon/palette.h | 4 --- include/wx/mac/carbon/pen.h | 4 --- include/wx/mac/carbon/region.h | 7 ----- include/wx/mac/classic/accel.h | 9 ------ include/wx/mac/classic/bitmap.h | 6 ---- include/wx/mac/classic/brush.h | 5 ---- include/wx/mac/classic/cursor.h | 6 ---- include/wx/mac/classic/font.h | 18 +----------- include/wx/mac/classic/icon.h | 7 ----- include/wx/mac/classic/metafile.h | 6 ---- include/wx/mac/classic/palette.h | 4 --- include/wx/mac/classic/pen.h | 4 --- include/wx/mac/classic/region.h | 7 ----- include/wx/mgl/bitmap.h | 2 -- include/wx/mgl/brush.h | 2 -- include/wx/mgl/cursor.h | 2 -- include/wx/mgl/font.h | 13 +-------- include/wx/mgl/icon.h | 2 -- include/wx/mgl/palette.h | 2 -- include/wx/mgl/pen.h | 2 -- include/wx/mgl/region.h | 6 ---- include/wx/motif/accel.h | 9 ++---- include/wx/motif/cursor.h | 7 +---- include/wx/motif/font.h | 11 +------- include/wx/motif/icon.h | 5 ---- include/wx/motif/palette.h | 2 -- include/wx/msw/accel.h | 12 +------- include/wx/msw/bitmap.h | 17 ++--------- include/wx/msw/brush.h | 2 -- include/wx/msw/colour.h | 5 ---- include/wx/msw/cursor.h | 4 --- include/wx/msw/font.h | 15 +--------- include/wx/msw/icon.h | 5 ---- include/wx/msw/metafile.h | 3 -- include/wx/msw/palette.h | 2 -- include/wx/msw/pen.h | 9 ------ include/wx/msw/region.h | 6 ---- include/wx/object.h | 47 +++++++++++++++---------------- include/wx/os2/accel.h | 6 ---- include/wx/os2/bitmap.h | 13 ++++----- include/wx/os2/brush.h | 2 -- include/wx/os2/cursor.h | 10 ------- include/wx/os2/font.h | 16 +---------- include/wx/os2/icon.h | 5 ---- include/wx/os2/metafile.h | 6 ---- include/wx/os2/palette.h | 2 -- include/wx/os2/pen.h | 3 -- include/wx/os2/region.h | 8 ------ include/wx/palmos/accel.h | 5 ---- include/wx/palmos/bitmap.h | 10 ------- include/wx/palmos/brush.h | 2 -- include/wx/palmos/cursor.h | 4 --- include/wx/palmos/font.h | 15 +--------- include/wx/palmos/icon.h | 5 ---- include/wx/palmos/metafile.h | 3 -- include/wx/palmos/palette.h | 2 -- include/wx/palmos/pen.h | 9 ------ include/wx/palmos/region.h | 6 ---- include/wx/x11/bitmap.h | 2 -- include/wx/x11/brush.h | 3 -- include/wx/x11/colour.h | 3 -- include/wx/x11/cursor.h | 2 -- include/wx/x11/font.h | 11 +------- include/wx/x11/icon.h | 2 -- include/wx/x11/palette.h | 2 -- include/wx/x11/pen.h | 3 -- include/wx/x11/region.h | 3 -- src/cocoa/font.cpp | 4 --- src/common/fontcmn.cpp | 8 ------ src/common/image.cpp | 11 -------- src/common/object.cpp | 9 ------ src/generic/paletteg.cpp | 13 --------- src/gtk/bitmap.cpp | 14 --------- src/gtk/cursor.cpp | 17 ----------- src/gtk/font.cpp | 6 ---- src/gtk/icon.cpp | 12 -------- src/mac/carbon/colour.cpp | 23 --------------- src/mac/carbon/font.cpp | 4 --- src/mac/classic/font.cpp | 3 -- src/mgl/bitmap.cpp | 12 -------- src/mgl/brush.cpp | 12 -------- src/mgl/cursor.cpp | 13 --------- src/mgl/icon.cpp | 13 --------- src/mgl/palette.cpp | 12 -------- src/mgl/pen.cpp | 12 -------- src/motif/font.cpp | 6 ---- src/msw/bitmap.cpp | 18 ------------ src/msw/brush.cpp | 10 ------- src/msw/colour.cpp | 16 ----------- src/msw/font.cpp | 4 --- src/os2/font.cpp | 4 --- src/palmos/brush.cpp | 5 ---- src/palmos/font.cpp | 4 --- src/x11/bitmap.cpp | 13 --------- src/x11/cursor.cpp | 16 ----------- src/x11/font.cpp | 6 ---- src/x11/icon.cpp | 12 -------- 125 files changed, 44 insertions(+), 892 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index ae8d1efa39..f7f576ea4d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -40,6 +40,7 @@ All: - Fixed build error in list.h with VC++ 2005. - Fixed wxODBC buffer overflow problem in Unicode builds. - Fixed wxSocketBase::InterruptWait on wxBase. +- Important code cleanup (Paul Cornett) All (GUI): diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index b853687661..5924b00d3e 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -79,9 +79,6 @@ private: class WXDLLEXPORT wxBitmapBase : public wxGDIObject { public: - wxBitmapBase() : wxGDIObject() {} - virtual ~wxBitmapBase() {} - /* 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); wxBitmap(char **bits); - wxBitmap(const wxBitmap& bmp); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM); wxBitmap(const wxImage& image, int depth = -1); - wxBitmap& operator = (const wxBitmap& bmp); bool operator == (const wxBitmap& bmp) const; bool operator != (const wxBitmap& bmp) const; diff --git a/include/wx/cocoa/bitmap.h b/include/wx/cocoa/bitmap.h index f1e4146d6b..d823a048f4 100644 --- a/include/wx/cocoa/bitmap.h +++ b/include/wx/cocoa/bitmap.h @@ -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 diff --git a/include/wx/cocoa/brush.h b/include/wx/cocoa/brush.h index d4e48e0733..689981f391 100644 --- a/include/wx/cocoa/brush.h +++ b/include/wx/cocoa/brush.h @@ -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; } diff --git a/include/wx/cocoa/cursor.h b/include/wx/cocoa/cursor.h index 25bd551455..bd054b0889 100644 --- a/include/wx/cocoa/cursor.h +++ b/include/wx/cocoa/cursor.h @@ -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; } diff --git a/include/wx/cocoa/font.h b/include/wx/cocoa/font.h index 477c3e0b9e..c0743e4441 100644 --- a/include/wx/cocoa/font.h +++ b/include/wx/cocoa/font.h @@ -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: diff --git a/include/wx/cocoa/icon.h b/include/wx/cocoa/icon.h index 79178d01aa..93e822526d 100644 --- a/include/wx/cocoa/icon.h +++ b/include/wx/cocoa/icon.h @@ -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); } diff --git a/include/wx/cocoa/pen.h b/include/wx/cocoa/pen.h index 642b0cca7d..236c326b70 100644 --- a/include/wx/cocoa/pen.h +++ b/include/wx/cocoa/pen.h @@ -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 diff --git a/include/wx/generic/accel.h b/include/wx/generic/accel.h index f69636a5b5..5bcdf83099 100644 --- a/include/wx/generic/accel.h +++ b/include/wx/generic/accel.h @@ -23,12 +23,6 @@ public: wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]); 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 bool operator==(const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; } diff --git a/include/wx/generic/paletteg.h b/include/wx/generic/paletteg.h index 0c0f7547dd..35a9fa1fa3 100644 --- a/include/wx/generic/paletteg.h +++ b/include/wx/generic/paletteg.h @@ -35,9 +35,7 @@ class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase wxPalette(); wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue ); - wxPalette( const wxPalette& palette ); ~wxPalette(); - wxPalette& operator = ( const wxPalette& palette ); bool operator == ( const wxPalette& palette ) const; bool operator != ( const wxPalette& palette ) const; virtual bool Ok() const; diff --git a/include/wx/generic/region.h b/include/wx/generic/region.h index 1163dc9be7..a4fc63a5bd 100644 --- a/include/wx/generic/region.h +++ b/include/wx/generic/region.h @@ -35,13 +35,6 @@ public: 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 operator == ( const wxRegionGeneric& region ) const; diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 33ec0f68be..29649632b9 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -71,11 +71,9 @@ public: wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); } - wxBitmap( const wxBitmap& bmp ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); wxBitmap( const wxImage& image, int depth = -1 ) { (void)CreateFromImage(image, depth); } ~wxBitmap(); - wxBitmap& operator = ( const wxBitmap& bmp ); bool operator == ( const wxBitmap& bmp ) const; bool operator != ( const wxBitmap& bmp ) const; bool Ok() const; diff --git a/include/wx/gtk/brush.h b/include/wx/gtk/brush.h index 1eb28335a6..8734ef18de 100644 --- a/include/wx/gtk/brush.h +++ b/include/wx/gtk/brush.h @@ -36,11 +36,6 @@ public: wxBrush( const wxBitmap &stippleBitmap ); ~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 operator == ( const wxBrush& brush ) const; diff --git a/include/wx/gtk/colour.h b/include/wx/gtk/colour.h index e168cb3810..c575cc5435 100644 --- a/include/wx/gtk/colour.h +++ b/include/wx/gtk/colour.h @@ -53,12 +53,6 @@ public: wxColour( const wxChar *colourName ) { InitFromName( wxString(colourName) ); } #endif - - wxColour( const wxColour& col ) - : wxGDIObject() - { Ref(col); } - wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; } - ~wxColour(); bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/gtk/cursor.h b/include/wx/gtk/cursor.h index a9964a07f8..1fe4410d33 100644 --- a/include/wx/gtk/cursor.h +++ b/include/wx/gtk/cursor.h @@ -28,7 +28,6 @@ public: wxCursor(); wxCursor( int cursorId ); - wxCursor( const wxCursor &cursor ); #if wxUSE_IMAGE wxCursor( const wxImage & image ); #endif @@ -36,7 +35,6 @@ public: int hotSpotX=-1, int hotSpotY=-1, const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 ); ~wxCursor(); - wxCursor& operator = ( const wxCursor& cursor ); bool operator == ( const wxCursor& cursor ) const; bool operator != ( const wxCursor& cursor ) const; bool Ok() const; diff --git a/include/wx/gtk/font.h b/include/wx/gtk/font.h index c14e0fc8cf..1f2840764b 100644 --- a/include/wx/gtk/font.h +++ b/include/wx/gtk/font.h @@ -29,15 +29,11 @@ class WXDLLIMPEXP_CORE wxFont; class WXDLLIMPEXP_CORE wxFont : public wxFontBase { public: - // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) : wxFontBase() { Init(); Ref(font); } + wxFont() { } // wxGTK-specific wxFont(const wxString& fontname) { - Init(); - Create(fontname); } @@ -51,8 +47,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -69,9 +63,6 @@ public: ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; diff --git a/include/wx/gtk/icon.h b/include/wx/gtk/icon.h index 00e65f06e6..9cb880054f 100644 --- a/include/wx/gtk/icon.h +++ b/include/wx/gtk/icon.h @@ -28,7 +28,6 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap { public: wxIcon(); - wxIcon( const wxIcon& icon); wxIcon( const char **bits, int width=-1, int height=-1 ); // 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 !(*this == icon); } diff --git a/include/wx/gtk/pen.h b/include/wx/gtk/pen.h index eb26d53b80..8be99f28b9 100644 --- a/include/wx/gtk/pen.h +++ b/include/wx/gtk/pen.h @@ -36,11 +36,6 @@ public: wxPen( const wxColour &colour, int width = 1, int style = wxSOLID ); ~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 operator == ( const wxPen& pen ) const; diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index f9925be044..80eca89536 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -80,11 +80,6 @@ public: ~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 operator == ( const wxRegion& region ) const; diff --git a/include/wx/image.h b/include/wx/image.h index b7b9d9a8d5..aa801035f6 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -190,9 +190,6 @@ public: wxImage( wxInputStream& stream, const wxString& mimetype, int index = -1 ); #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, unsigned char* data, 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 void RotateHue(double angle); - wxImage& operator = (const wxImage& image) - { - if ( (*this) != image ) - Ref(image); - return *this; - } - bool operator == (const wxImage& image) const { return m_refData == image.m_refData; } bool operator != (const wxImage& image) const diff --git a/include/wx/mac/carbon/accel.h b/include/wx/mac/carbon/accel.h index 6d34d460d8..9702282af9 100644 --- a/include/wx/mac/carbon/accel.h +++ b/include/wx/mac/carbon/accel.h @@ -22,17 +22,8 @@ public: wxAcceleratorTable(); 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& 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 diff --git a/include/wx/mac/carbon/bitmap.h b/include/wx/mac/carbon/bitmap.h index a9b14b7713..29772d299b 100644 --- a/include/wx/mac/carbon/bitmap.h +++ b/include/wx/mac/carbon/bitmap.h @@ -104,13 +104,6 @@ class WXDLLEXPORT wxBitmap: public wxBitmapBase public: wxBitmap(); // Platform-specific - // Copy constructors - wxBitmap(const wxBitmap& bitmap) - : wxBitmapBase() - { - Ref(bitmap); - } - // Initialize with raw data. wxBitmap(const char bits[], int width, int height, int depth = 1); @@ -177,7 +170,6 @@ public: wxMask *GetMask() const; 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; } diff --git a/include/wx/mac/carbon/brush.h b/include/wx/mac/carbon/brush.h index 7ffb716cb0..31b9593ab0 100644 --- a/include/wx/mac/carbon/brush.h +++ b/include/wx/mac/carbon/brush.h @@ -35,9 +35,6 @@ public: wxBrush(short macThemeBrush ) ; wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxBitmap& stipple); - wxBrush(const wxBrush& brush) - : wxBrushBase() - { Ref(brush); } ~wxBrush(); virtual void SetColour(const wxColour& col) ; @@ -47,8 +44,6 @@ public: virtual void MacSetTheme(short macThemeBrush) ; 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 { return m_refData == brush.m_refData; } bool operator != (const wxBrush& brush) const diff --git a/include/wx/mac/carbon/colour.h b/include/wx/mac/carbon/colour.h index f84671f77f..bc015e9ecd 100644 --- a/include/wx/mac/carbon/colour.h +++ b/include/wx/mac/carbon/colour.h @@ -39,10 +39,6 @@ public: wxColour( const wxChar *colourName ) { InitFromName(colourName); } - // copy ctors and assignment operators - wxColour( const wxColour& col ); - wxColour& operator = ( const wxColour& col ); - // dtor ~wxColour(); diff --git a/include/wx/mac/carbon/cursor.h b/include/wx/mac/carbon/cursor.h index def15d07ba..cf62dbf40a 100644 --- a/include/wx/mac/carbon/cursor.h +++ b/include/wx/mac/carbon/cursor.h @@ -22,11 +22,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); @@ -42,7 +37,6 @@ public: bool CreateFromXpm(const char **bits) ; 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; } diff --git a/include/wx/mac/carbon/font.h b/include/wx/mac/carbon/font.h index c28ed650b7..f513354e35 100644 --- a/include/wx/mac/carbon/font.h +++ b/include/wx/mac/carbon/font.h @@ -20,13 +20,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, @@ -36,15 +30,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); } @@ -64,9 +54,6 @@ public: virtual ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; @@ -111,9 +98,6 @@ public: void* MacGetATSUStyle() const ; protected: - // common part of all ctors - void Init(); - void Unshare(); private: diff --git a/include/wx/mac/carbon/icon.h b/include/wx/mac/carbon/icon.h index 64bdcc74ff..3adb3f7e0d 100644 --- a/include/wx/mac/carbon/icon.h +++ b/include/wx/mac/carbon/icon.h @@ -20,13 +20,6 @@ class WXDLLEXPORT wxIcon: public wxGDIObject public: wxIcon(); - // Copy constructors - wxIcon(const wxIcon& icon) - : wxGDIObject() - { - Ref(icon); - } - wxIcon(const char **data); wxIcon(char **data); wxIcon(const char bits[], int width , int height ); @@ -43,8 +36,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); } diff --git a/include/wx/mac/carbon/metafile.h b/include/wx/mac/carbon/metafile.h index 93ff61d9e6..add0be172a 100644 --- a/include/wx/mac/carbon/metafile.h +++ b/include/wx/mac/carbon/metafile.h @@ -39,11 +39,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject { DECLARE_DYNAMIC_CLASS(wxMetafile) public: - // Copy constructor - wxMetafile(const wxMetafile& metafile) - : wxGDIObject() - { Ref(metafile); } - wxMetafile(const wxString& file = wxEmptyString); ~wxMetafile(void); @@ -63,7 +58,6 @@ public: void SetHMETAFILE(WXHMETAFILE mf) ; // 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; } diff --git a/include/wx/mac/carbon/palette.h b/include/wx/mac/carbon/palette.h index 96222de640..ada43c0b8a 100644 --- a/include/wx/mac/carbon/palette.h +++ b/include/wx/mac/carbon/palette.h @@ -38,9 +38,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: wxPalette(); - wxPalette(const wxPalette& palette) - : wxPaletteBase() - { Ref(palette); } wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); ~wxPalette(); @@ -50,7 +47,6 @@ public: 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; } diff --git a/include/wx/mac/carbon/pen.h b/include/wx/mac/carbon/pen.h index 1a3ea6b8fd..5ff21fcf2b 100644 --- a/include/wx/mac/carbon/pen.h +++ b/include/wx/mac/carbon/pen.h @@ -52,12 +52,8 @@ 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(); - 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; } diff --git a/include/wx/mac/carbon/region.h b/include/wx/mac/carbon/region.h index 21831e4e54..ce3a08204a 100644 --- a/include/wx/mac/carbon/region.h +++ b/include/wx/mac/carbon/region.h @@ -54,13 +54,6 @@ public: ~wxRegion(); - //# Copying - wxRegion(const wxRegion& r) - : wxGDIObject() - { Ref(r); } - wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - //# Modify region // Clear current region void Clear(); diff --git a/include/wx/mac/classic/accel.h b/include/wx/mac/classic/accel.h index 6d34d460d8..9702282af9 100644 --- a/include/wx/mac/classic/accel.h +++ b/include/wx/mac/classic/accel.h @@ -22,17 +22,8 @@ public: wxAcceleratorTable(); 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& 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 diff --git a/include/wx/mac/classic/bitmap.h b/include/wx/mac/classic/bitmap.h index 70bfdb4949..7380a5486a 100644 --- a/include/wx/mac/classic/bitmap.h +++ b/include/wx/mac/classic/bitmap.h @@ -133,11 +133,6 @@ class WXDLLEXPORT wxBitmap: public wxBitmapBase public: wxBitmap(); // Platform-specific - // Copy constructors - wxBitmap(const wxBitmap& bitmap) - : wxBitmapBase() - { Ref(bitmap); } - // Initialize with raw data. wxBitmap(const char bits[], int width, int height, int depth = 1); @@ -194,7 +189,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 { return m_refData != bitmap.m_refData; } diff --git a/include/wx/mac/classic/brush.h b/include/wx/mac/classic/brush.h index 4333b5f0f4..5c65beb50d 100644 --- a/include/wx/mac/classic/brush.h +++ b/include/wx/mac/classic/brush.h @@ -35,9 +35,6 @@ public: wxBrush(short macThemeBrush ) ; wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxBitmap& stipple); - wxBrush(const wxBrush& brush) - : wxBrushBase() - { Ref(brush); } ~wxBrush(); virtual void SetColour(const wxColour& col) ; @@ -47,8 +44,6 @@ public: virtual void SetMacTheme(short macThemeBrush) ; 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 { return m_refData == brush.m_refData; } bool operator != (const wxBrush& brush) const diff --git a/include/wx/mac/classic/cursor.h b/include/wx/mac/classic/cursor.h index 2ceb41e993..a18b2b9a96 100644 --- a/include/wx/mac/classic/cursor.h +++ b/include/wx/mac/classic/cursor.h @@ -43,11 +43,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); @@ -63,7 +58,6 @@ public: bool CreateFromXpm(const char **bits) ; 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; } diff --git a/include/wx/mac/classic/font.h b/include/wx/mac/classic/font.h index 402a0a488b..4fdbfef398 100644 --- a/include/wx/mac/classic/font.h +++ b/include/wx/mac/classic/font.h @@ -20,13 +20,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, @@ -36,15 +30,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); } @@ -62,9 +52,6 @@ public: virtual ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; @@ -99,9 +86,6 @@ public: wxUint32 GetMacATSUFontID() const; protected: - // common part of all ctors - void Init(); - void Unshare(); private: diff --git a/include/wx/mac/classic/icon.h b/include/wx/mac/classic/icon.h index ca42a7b242..8a137f6d18 100644 --- a/include/wx/mac/classic/icon.h +++ b/include/wx/mac/classic/icon.h @@ -20,11 +20,6 @@ class WXDLLEXPORT wxIcon: public wxBitmap public: wxIcon(); - // Copy constructors - wxIcon(const wxIcon& icon) - : wxBitmap() - { Ref(icon); } - wxIcon(const char **data); wxIcon(char **data); wxIcon(const char bits[], int width , int height ); @@ -41,8 +36,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); } diff --git a/include/wx/mac/classic/metafile.h b/include/wx/mac/classic/metafile.h index 7026e1bc54..c4ae5d1047 100644 --- a/include/wx/mac/classic/metafile.h +++ b/include/wx/mac/classic/metafile.h @@ -50,11 +50,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject { DECLARE_DYNAMIC_CLASS(wxMetafile) public: - // Copy constructor - wxMetafile(const wxMetafile& metafile) - : wxGDIObject() - { Ref(metafile); } - wxMetafile(const wxString& file = wxEmptyString); ~wxMetafile(void); @@ -74,7 +69,6 @@ public: void SetHMETAFILE(WXHMETAFILE mf) ; // 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; } diff --git a/include/wx/mac/classic/palette.h b/include/wx/mac/classic/palette.h index c888113b88..e800fd4232 100644 --- a/include/wx/mac/classic/palette.h +++ b/include/wx/mac/classic/palette.h @@ -38,9 +38,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: wxPalette(); - wxPalette(const wxPalette& palette) - : wxPaletteBase() - { Ref(palette); } wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); ~wxPalette(); @@ -50,7 +47,6 @@ public: 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; } diff --git a/include/wx/mac/classic/pen.h b/include/wx/mac/classic/pen.h index fba7b41cc5..f9bf0775d8 100644 --- a/include/wx/mac/classic/pen.h +++ b/include/wx/mac/classic/pen.h @@ -52,12 +52,8 @@ 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(); - 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; } diff --git a/include/wx/mac/classic/region.h b/include/wx/mac/classic/region.h index ee60da5462..7c10bd8e5e 100644 --- a/include/wx/mac/classic/region.h +++ b/include/wx/mac/classic/region.h @@ -53,13 +53,6 @@ public: ~wxRegion(); - //# Copying - wxRegion(const wxRegion& r) - : wxGDIObject() - { Ref(r); } - wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - //# Modify region // Clear current region void Clear(); diff --git a/include/wx/mgl/bitmap.h b/include/wx/mgl/bitmap.h index 197b87e0c4..97adf8cacf 100644 --- a/include/wx/mgl/bitmap.h +++ b/include/wx/mgl/bitmap.h @@ -75,11 +75,9 @@ public: wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char **bits) { CreateFromXpm(bits); } wxBitmap(char **bits) { CreateFromXpm((const char **)bits); } - wxBitmap(const wxBitmap& bmp); wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE); wxBitmap(const wxImage& image, int depth = -1); ~wxBitmap() {} - wxBitmap& operator = (const wxBitmap& bmp); bool operator == (const wxBitmap& bmp) const; bool operator != (const wxBitmap& bmp) const; bool Ok() const; diff --git a/include/wx/mgl/brush.h b/include/wx/mgl/brush.h index cdb9dc8fb2..ae8f784b80 100644 --- a/include/wx/mgl/brush.h +++ b/include/wx/mgl/brush.h @@ -33,9 +33,7 @@ public: wxBrush() {} wxBrush(const wxColour &colour, int style = wxSOLID); wxBrush(const wxBitmap &stippleBitmap); - wxBrush(const wxBrush &brush); ~wxBrush() {} - wxBrush& operator = (const wxBrush& brush); bool operator == (const wxBrush& brush) const; bool operator != (const wxBrush& brush) const; bool Ok() const; diff --git a/include/wx/mgl/cursor.h b/include/wx/mgl/cursor.h index b24f033728..c3146e569d 100644 --- a/include/wx/mgl/cursor.h +++ b/include/wx/mgl/cursor.h @@ -26,7 +26,6 @@ public: wxCursor(); wxCursor(int cursorId); - wxCursor(const wxCursor &cursor); wxCursor(const char bits[], int width, int height, int hotSpotX=-1, int hotSpotY=-1, const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0); @@ -34,7 +33,6 @@ public: long flags = wxBITMAP_TYPE_CUR_RESOURCE, int hotSpotX = 0, int hotSpotY = 0); ~wxCursor(); - wxCursor& operator = ( const wxCursor& cursor ); bool operator == (const wxCursor& cursor) const; bool operator != (const wxCursor& cursor) const; bool Ok() const; diff --git a/include/wx/mgl/font.h b/include/wx/mgl/font.h index 1c7fa790f6..2437ede286 100644 --- a/include/wx/mgl/font.h +++ b/include/wx/mgl/font.h @@ -30,13 +30,10 @@ class WXDLLEXPORT wxFont : public wxFontBase { public: // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) { Init(); Ref(font); } + wxFont() { } wxFont(const wxNativeFontInfo& info) { - Init(); - (void)Create(info); } @@ -48,8 +45,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -65,9 +60,6 @@ public: ~wxFont() {} - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; @@ -90,9 +82,6 @@ public: struct font_t *GetMGLfont_t(float scale, bool antialiased); protected: - // common part of all ctors - void Init() {} - // ref counting code virtual wxObjectRefData *CreateRefData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; diff --git a/include/wx/mgl/icon.h b/include/wx/mgl/icon.h index bd897febc7..03d1c437a1 100644 --- a/include/wx/mgl/icon.h +++ b/include/wx/mgl/icon.h @@ -28,7 +28,6 @@ class WXDLLEXPORT wxIcon: public wxBitmap { public: wxIcon() : wxBitmap() {} - wxIcon(const wxIcon& icon); wxIcon(const 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 !(*this == icon); } diff --git a/include/wx/mgl/palette.h b/include/wx/mgl/palette.h index a9878d2676..436f02b208 100644 --- a/include/wx/mgl/palette.h +++ b/include/wx/mgl/palette.h @@ -34,9 +34,7 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: wxPalette(); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - wxPalette(const wxPalette& palette); ~wxPalette(); - wxPalette& operator = (const wxPalette& palette); bool operator == (const wxPalette& palette) const; bool operator != (const wxPalette& palette) const; virtual bool Ok() const; diff --git a/include/wx/mgl/pen.h b/include/wx/mgl/pen.h index 1bedb8ace5..7b5edafd3b 100644 --- a/include/wx/mgl/pen.h +++ b/include/wx/mgl/pen.h @@ -33,9 +33,7 @@ public: wxPen() {} wxPen(const wxColour &colour, int width = 1, int style = wxSOLID); wxPen(const wxBitmap& stipple, int width); - wxPen(const wxPen& pen); ~wxPen() {} - wxPen& operator = (const wxPen& pen); bool operator == (const wxPen& pen) const; bool operator != (const wxPen& pen) const; diff --git a/include/wx/mgl/region.h b/include/wx/mgl/region.h index c5f7a9464e..7bc3b81b44 100644 --- a/include/wx/mgl/region.h +++ b/include/wx/mgl/region.h @@ -49,12 +49,6 @@ public: wxRegion(); ~wxRegion(); - //# Copying - inline wxRegion(const wxRegion& r) - { Ref(r); } - inline wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - //# Modify region // Clear current region void Clear(void); diff --git a/include/wx/motif/accel.h b/include/wx/motif/accel.h index 78605a9c4c..d67392b8ee 100644 --- a/include/wx/motif/accel.h +++ b/include/wx/motif/accel.h @@ -23,14 +23,9 @@ public: wxAcceleratorTable(); wxAcceleratorTable(const wxString& resource); // Load from .rc resource 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& 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; } diff --git a/include/wx/motif/cursor.h b/include/wx/motif/cursor.h index 6442dabda5..e0882ffc64 100644 --- a/include/wx/motif/cursor.h +++ b/include/wx/motif/cursor.h @@ -24,10 +24,7 @@ class WXDLLEXPORT wxCursor: public wxObject public: wxCursor(); - - // Copy constructors - wxCursor(const wxCursor& cursor) { Ref(cursor); } - + wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, const char maskBits[] = NULL); @@ -44,8 +41,6 @@ public: virtual bool Ok() const; - wxCursor& operator = (const wxCursor& cursor) - { if (*this == cursor) return (*this); Ref(cursor); return *this; } bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; } bool operator != (const wxCursor& cursor) const diff --git a/include/wx/motif/font.h b/include/wx/motif/font.h index 160a9acfcc..3c7fb4b05c 100644 --- a/include/wx/motif/font.h +++ b/include/wx/motif/font.h @@ -27,8 +27,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase { public: // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) { Init(); Ref(font); } + wxFont() { } wxFont(int size, int family, @@ -38,8 +37,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -60,9 +57,6 @@ public: virtual ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; @@ -120,9 +114,6 @@ public: protected: virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); - // common part of all ctors - void Init(); - void Unshare(); private: diff --git a/include/wx/motif/icon.h b/include/wx/motif/icon.h index fbd77dcd02..fbee1048be 100644 --- a/include/wx/motif/icon.h +++ b/include/wx/motif/icon.h @@ -20,9 +20,6 @@ class WXDLLEXPORT wxIcon : public wxBitmap public: wxIcon(); - // Copy constructors - inline wxIcon(const wxIcon& icon) { Ref(icon); } - // Initialize with XBM data wxIcon(const char bits[], int width, int height); @@ -58,8 +55,6 @@ public: // ctors, assignment operators...), but it's ok to have such function void CopyFromBitmap(const wxBitmap& bmp); - 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 diff --git a/include/wx/motif/palette.h b/include/wx/motif/palette.h index 2ba91c323a..a1fa11be7e 100644 --- a/include/wx/motif/palette.h +++ b/include/wx/motif/palette.h @@ -51,7 +51,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: wxPalette(); - wxPalette(const wxPalette& palette) { Ref(palette); } wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); ~wxPalette(); @@ -61,7 +60,6 @@ public: 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; } diff --git a/include/wx/msw/accel.h b/include/wx/msw/accel.h index 34b3cd07d4..ee7dc5dc32 100644 --- a/include/wx/msw/accel.h +++ b/include/wx/msw/accel.h @@ -20,10 +20,7 @@ class WXDLLEXPORT wxAcceleratorTable : public wxObject { public: // default ctor - wxAcceleratorTable() : wxObject() { } - - // copy ctor - wxAcceleratorTable(const wxAcceleratorTable& accel) : wxObject(accel) { Ref(accel); } + wxAcceleratorTable() { } // load from .rc resource (Windows specific) wxAcceleratorTable(const wxString& resource); @@ -31,13 +28,6 @@ public: // initialize from array 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 { return !(*this == accel); } diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index c9d9e38445..1959abaaf8 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -39,10 +39,7 @@ class WXDLLEXPORT wxBitmap : public wxGDIImage { public: // default ctor creates an invalid bitmap, you must Create() it later - wxBitmap() { Init(); } - - // Copy constructors - wxBitmap(const wxBitmap& bitmap) : wxGDIImage(bitmap) { Init(); Ref(bitmap); } + wxBitmap() { } // Initialize with raw data 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 // the copy ctor but the resulting bitmap is invalid! - wxBitmap(const wxIcon& icon) { Init(); CopyFromIcon(icon); } - - wxBitmap& operator=(const wxBitmap& bitmap) - { - if ( m_refData != bitmap.m_refData ) - Ref(bitmap); - return *this; - } + wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); } wxBitmap& operator=(const wxIcon& icon) { @@ -172,9 +162,6 @@ public: #endif // __WXDEBUG__ protected: - // common part of all ctors - void Init(); - virtual wxGDIImageRefData *CreateData() const; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; diff --git a/include/wx/msw/brush.h b/include/wx/msw/brush.h index 22784809f2..4a83d7b57d 100644 --- a/include/wx/msw/brush.h +++ b/include/wx/msw/brush.h @@ -28,7 +28,6 @@ public: wxBrush(); wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxBitmap& stipple); - wxBrush(const wxBrush& brush) : wxBrushBase(brush) { Ref(brush); } virtual ~wxBrush(); virtual void SetColour(const wxColour& col); @@ -36,7 +35,6 @@ public: virtual void SetStyle(int style); virtual void SetStipple(const wxBitmap& stipple); - wxBrush& operator=(const wxBrush& brush); bool operator==(const wxBrush& brush) const; bool operator!=(const wxBrush& brush) const { return !(*this == brush); } diff --git a/include/wx/msw/colour.h b/include/wx/msw/colour.h index 556a5b9621..824ab55c10 100644 --- a/include/wx/msw/colour.h +++ b/include/wx/msw/colour.h @@ -38,11 +38,6 @@ public: wxColour(const wxString &colourName) { InitFromName(colourName); } wxColour(const wxChar *colourName) { InitFromName(colourName); } - - // copy ctors and assignment operators - wxColour(const wxColour& col); - wxColour& operator=( const wxColour& col); - // dtor ~wxColour(); diff --git a/include/wx/msw/cursor.h b/include/wx/msw/cursor.h index 27c9bedc85..2e194f10f2 100644 --- a/include/wx/msw/cursor.h +++ b/include/wx/msw/cursor.h @@ -22,7 +22,6 @@ class WXDLLEXPORT wxCursor : public wxGDIImage public: // constructors wxCursor(); - wxCursor(const wxCursor& cursor) : wxGDIImage(cursor) { Ref(cursor); } wxCursor(const wxImage& image); wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, @@ -33,9 +32,6 @@ public: wxCursor(int idCursor); 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 { return !(*this == cursor); } diff --git a/include/wx/msw/font.h b/include/wx/msw/font.h index f9ff12304e..c94d02a71c 100644 --- a/include/wx/msw/font.h +++ b/include/wx/msw/font.h @@ -22,8 +22,7 @@ class WXDLLEXPORT wxFont : public wxFontBase { public: // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); } + wxFont() { } wxFont(int size, int family, @@ -33,8 +32,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -46,16 +43,12 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(pixelSize, family, style, weight, underlined, face, encoding); } wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0) { - Init(); - Create(info, hFont); } @@ -89,9 +82,6 @@ public: virtual ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual wxSize GetPixelSize() const; @@ -145,9 +135,6 @@ protected: virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); - // common part of all ctors - void Init(); - void Unshare(); private: diff --git a/include/wx/msw/icon.h b/include/wx/msw/icon.h index 4fa08e2f6a..8682193961 100644 --- a/include/wx/msw/icon.h +++ b/include/wx/msw/icon.h @@ -44,9 +44,6 @@ public: // default wxIcon() { } - // copy - wxIcon(const wxIcon& icon) : wxGDIImage(icon) { Ref(icon); } - // from raw data wxIcon(const char bits[], int width, int height); @@ -68,8 +65,6 @@ public: long type = wxBITMAP_TYPE_ICO_RESOURCE, int desiredWidth = -1, int desiredHeight = -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 diff --git a/include/wx/msw/metafile.h b/include/wx/msw/metafile.h index 5bca9a99f0..95c316092c 100644 --- a/include/wx/msw/metafile.h +++ b/include/wx/msw/metafile.h @@ -44,7 +44,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject { public: wxMetafile(const wxString& file = wxEmptyString); - wxMetafile(const wxMetafile& metafile) { Ref(metafile); } virtual ~wxMetafile(); // After this is called, the metafile cannot be used for anything @@ -69,8 +68,6 @@ public: void SetWindowsMappingMode(int mm); // Operators - wxMetafile& operator=(const wxMetafile& metafile) - { if (*this != metafile) Ref(metafile); return *this; } bool operator==(const wxMetafile& metafile) const { return m_refData == metafile.m_refData; } bool operator!=(const wxMetafile& metafile) const diff --git a/include/wx/msw/palette.h b/include/wx/msw/palette.h index 748d14b9ec..761efefa10 100644 --- a/include/wx/msw/palette.h +++ b/include/wx/msw/palette.h @@ -34,7 +34,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: 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(void); @@ -44,7 +43,6 @@ public: 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; } diff --git a/include/wx/msw/pen.h b/include/wx/msw/pen.h index 56560d3834..7e682576d4 100644 --- a/include/wx/msw/pen.h +++ b/include/wx/msw/pen.h @@ -77,17 +77,8 @@ public: wxPen(); wxPen(const wxColour& col, int width = 1, int style = wxSOLID); wxPen(const wxBitmap& stipple, int width); - wxPen(const wxPen& pen) : wxGDIObject(pen) { Ref(pen); } virtual ~wxPen(); - wxPen& operator=(const wxPen& pen) - { - if ( this != &pen ) - Ref(pen); - - return *this; - } - bool operator==(const wxPen& pen) const { const wxPenRefData *penData = (wxPenRefData *)pen.m_refData; diff --git a/include/wx/msw/region.h b/include/wx/msw/region.h index 848a519e60..d6cac7c667 100644 --- a/include/wx/msw/region.h +++ b/include/wx/msw/region.h @@ -56,12 +56,6 @@ public: virtual ~wxRegion(); - // Copying - wxRegion(const wxRegion& r) : wxGDIObject(r) - { Ref(r); } - wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - // Modify region // ------------- diff --git a/include/wx/object.h b/include/wx/object.h index d24af71257..17e4682d6d 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -380,6 +380,24 @@ inline void* wxCheckCast(void *ptr) #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 // ---------------------------------------------------------------------------- @@ -388,24 +406,22 @@ class WXDLLIMPEXP_BASE wxObject { DECLARE_ABSTRACT_CLASS(wxObject) -private: - void InitFrom(const wxObject& other); - public: wxObject() { m_refData = NULL; } virtual ~wxObject() { UnRef(); } wxObject(const wxObject& other) { - InitFrom(other); + m_refData = other.m_refData; + if (m_refData) + m_refData->m_count++; } wxObject& operator=(const wxObject& other) { if ( this != &other ) { - UnRef(); - InitFrom(other); + Ref(other); } return *this; } @@ -485,25 +501,6 @@ protected: 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) { return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL; diff --git a/include/wx/os2/accel.h b/include/wx/os2/accel.h index 1614b06818..60f3de60c0 100644 --- a/include/wx/os2/accel.h +++ b/include/wx/os2/accel.h @@ -38,14 +38,8 @@ public: ,const wxAcceleratorEntry vaEntries[] ); // Load from array - // Copy constructors - inline wxAcceleratorTable(const wxAcceleratorTable& rAccel) { Ref(rAccel); } - inline wxAcceleratorTable(const wxAcceleratorTable* pAccel) { if (pAccel) Ref(*pAccel); } - ~wxAcceleratorTable(); - inline wxAcceleratorTable& operator = (const wxAcceleratorTable& rAccel) - { if (*this == rAccel) return (*this); Ref(rAccel); return *this; }; inline bool operator== (const wxAcceleratorTable& rAccel) const { return m_refData == rAccel.m_refData; }; inline bool operator!= (const wxAcceleratorTable& rAccel) const diff --git a/include/wx/os2/bitmap.h b/include/wx/os2/bitmap.h index e1953d3034..eba49f641b 100644 --- a/include/wx/os2/bitmap.h +++ b/include/wx/os2/bitmap.h @@ -70,7 +70,11 @@ public: // Copy constructors inline wxBitmap(const wxBitmap& rBitmap) - { Init(); Ref(rBitmap); SetHandle(rBitmap.GetHandle()); } + : wxGDIImage(rBitmap) + { + Init(); + SetHandle(rBitmap.GetHandle()); + } // Initialize with raw data wxBitmap( const char bits[] @@ -112,13 +116,6 @@ public: inline wxBitmap(const wxIcon& rIcon) { Init(); CopyFromIcon(rIcon); } - wxBitmap& operator=(const wxBitmap& rBitmap) - { - if ( m_refData != rBitmap.m_refData ) - Ref(rBitmap); - return(*this); - } - wxBitmap& operator=(const wxIcon& rIcon) { (void)CopyFromIcon(rIcon); diff --git a/include/wx/os2/brush.h b/include/wx/os2/brush.h index da2153c90b..877ee04e51 100644 --- a/include/wx/os2/brush.h +++ b/include/wx/os2/brush.h @@ -45,10 +45,8 @@ public: wxBrush(); wxBrush(const wxColour& rCol, int nStyle = wxSOLID); wxBrush(const wxBitmap& rStipple); - inline wxBrush(const wxBrush& rBrush) { Ref(rBrush); } ~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; } diff --git a/include/wx/os2/cursor.h b/include/wx/os2/cursor.h index eee0aeba20..029dec50cb 100644 --- a/include/wx/os2/cursor.h +++ b/include/wx/os2/cursor.h @@ -32,8 +32,6 @@ class WXDLLEXPORT wxCursor: public wxBitmap public: wxCursor(); - // Copy constructors - wxCursor(const wxCursor& rCursor) { Ref(rCursor); } wxCursor(const wxImage& rImage); wxCursor( const char acBits[] @@ -50,14 +48,6 @@ public: ); wxCursor(int nCursorType); 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; } diff --git a/include/wx/os2/font.h b/include/wx/os2/font.h index 314d445d7b..ba85180513 100644 --- a/include/wx/os2/font.h +++ b/include/wx/os2/font.h @@ -25,8 +25,7 @@ class WXDLLEXPORT wxFont : public wxFontBase { public: // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& rFont) { Init(); Ref(rFont); } + wxFont() { } wxFont( int nSize ,int nFamily @@ -37,8 +36,6 @@ public: ,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT ) { - Init(); - (void)Create( nSize ,nFamily ,nStyle @@ -54,8 +51,6 @@ public: ) { - Init(); - (void)Create( rInfo ,hFont ); @@ -77,11 +72,6 @@ public: virtual ~wxFont(); - // - // Assignment - // - wxFont& operator=(const wxFont& rFont); - // // Implement base class pure virtuals // @@ -123,10 +113,6 @@ public: protected: virtual void DoSetNativeFontInfo(const wxNativeFontInfo& rInfo); - // - // Common part of all ctors - // - void Init(void); void Unshare(void); private: diff --git a/include/wx/os2/icon.h b/include/wx/os2/icon.h index 2f000c4aa4..08f54374f2 100644 --- a/include/wx/os2/icon.h +++ b/include/wx/os2/icon.h @@ -40,9 +40,6 @@ class WXDLLEXPORT wxIcon: public wxIconBase public: wxIcon(); - // Copy constructors - inline wxIcon(const wxIcon& icon) { Ref(icon); } - wxIcon( const char bits[] ,int nWidth ,int nHeight @@ -67,8 +64,6 @@ public: ,int nDesiredHeight = -1 ); - inline wxIcon& operator = (const wxIcon& rIcon) - { if (*this != rIcon) Ref(rIcon); return *this; } inline bool operator == (const wxIcon& rIcon) const { return m_refData == rIcon.m_refData; } inline bool operator != (const wxIcon& rIcon) const diff --git a/include/wx/os2/metafile.h b/include/wx/os2/metafile.h index 802c9a3568..332bab1c94 100644 --- a/include/wx/os2/metafile.h +++ b/include/wx/os2/metafile.h @@ -50,10 +50,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject { DECLARE_DYNAMIC_CLASS(wxMetafile) public: - // Copy constructor - inline wxMetafile(const wxMetafile& metafile) - { Ref(metafile); } - wxMetafile(const wxString& file = wxEmptyString); ~wxMetafile(void); @@ -71,8 +67,6 @@ public: void SetWindowsMappingMode(int mm); // 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 diff --git a/include/wx/os2/palette.h b/include/wx/os2/palette.h index 3e90e05682..0ffd177910 100644 --- a/include/wx/os2/palette.h +++ b/include/wx/os2/palette.h @@ -36,7 +36,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: wxPalette(); - inline wxPalette(const wxPalette& rPalette) { Ref(rPalette); } wxPalette( int n ,const unsigned char* pRed @@ -62,7 +61,6 @@ public: 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 { return m_refData == rPalette.m_refData; } inline bool operator != (const wxPalette& rPalette) const diff --git a/include/wx/os2/pen.h b/include/wx/os2/pen.h index e89c11a158..2185169aff 100644 --- a/include/wx/os2/pen.h +++ b/include/wx/os2/pen.h @@ -52,11 +52,8 @@ public: wxPen( const wxBitmap& rStipple ,int nWidth ); - inline wxPen(const wxPen& rPen) { Ref(rPen); } ~wxPen(); - inline wxPen& operator = (const wxPen& rPen) - { if (*this == rPen) return (*this); Ref(rPen); return *this; } inline bool operator == (const wxPen& rPen) const { return m_refData == rPen.m_refData; } inline bool operator != (const wxPen& rPen) const diff --git a/include/wx/os2/region.h b/include/wx/os2/region.h index 6205315f22..348f24008b 100644 --- a/include/wx/os2/region.h +++ b/include/wx/os2/region.h @@ -59,14 +59,6 @@ public: wxRegion(); ~wxRegion(); - // - // Copying - // - inline wxRegion(const wxRegion& rSrc) - { Ref(rSrc); } - inline wxRegion& operator = (const wxRegion& rSrc) - { Ref(rSrc); return (*this); } - // // Modify region // diff --git a/include/wx/palmos/accel.h b/include/wx/palmos/accel.h index 1fdc34b5a7..e1970d25b7 100644 --- a/include/wx/palmos/accel.h +++ b/include/wx/palmos/accel.h @@ -22,9 +22,6 @@ public: // default ctor wxAcceleratorTable(); - // copy ctor - wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); } - // load from .rc resource (Windows specific) wxAcceleratorTable(const wxString& resource); @@ -33,8 +30,6 @@ public: virtual ~wxAcceleratorTable(); - wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if ( *this != accel ) Ref(accel); return *this; } - #if WXWIN_COMPATIBILITY_2_4 bool operator==(const wxAcceleratorTable& accel) const { return m_refData == accel.m_refData; } diff --git a/include/wx/palmos/bitmap.h b/include/wx/palmos/bitmap.h index ef547bf64d..076784bc5a 100644 --- a/include/wx/palmos/bitmap.h +++ b/include/wx/palmos/bitmap.h @@ -41,9 +41,6 @@ public: // default ctor creates an invalid bitmap, you must Create() it later wxBitmap() { Init(); } - // Copy constructors - wxBitmap(const wxBitmap& bitmap) { Init(); Ref(bitmap); } - // Initialize with raw data 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! 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) { (void)CopyFromIcon(icon); diff --git a/include/wx/palmos/brush.h b/include/wx/palmos/brush.h index 37b4f2388f..4e2cbbbb0f 100644 --- a/include/wx/palmos/brush.h +++ b/include/wx/palmos/brush.h @@ -28,7 +28,6 @@ public: wxBrush(); wxBrush(const wxColour& col, int style = wxSOLID); wxBrush(const wxBitmap& stipple); - wxBrush(const wxBrush& brush) { Ref(brush); } virtual ~wxBrush(); virtual void SetColour(const wxColour& col); @@ -36,7 +35,6 @@ public: virtual void SetStyle(int style); virtual void SetStipple(const wxBitmap& stipple); - wxBrush& operator=(const wxBrush& brush); bool operator==(const wxBrush& brush) const; bool operator!=(const wxBrush& brush) const { return !(*this == brush); } diff --git a/include/wx/palmos/cursor.h b/include/wx/palmos/cursor.h index ed374896a3..ef083421ad 100644 --- a/include/wx/palmos/cursor.h +++ b/include/wx/palmos/cursor.h @@ -22,7 +22,6 @@ class WXDLLEXPORT wxCursor : public wxGDIImage public: // constructors wxCursor(); - wxCursor(const wxCursor& cursor) { Ref(cursor); } wxCursor(const wxImage& image); wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, @@ -33,9 +32,6 @@ public: wxCursor(int idCursor); 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 { return !(*this == cursor); } diff --git a/include/wx/palmos/font.h b/include/wx/palmos/font.h index 3ec690b1e7..146e45eeff 100644 --- a/include/wx/palmos/font.h +++ b/include/wx/palmos/font.h @@ -22,8 +22,7 @@ class WXDLLEXPORT wxFont : public wxFontBase { public: // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) : wxFontBase(font) { Init(); Ref(font); } + wxFont() { } wxFont(int size, int family, @@ -33,8 +32,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -46,16 +43,12 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(pixelSize, family, style, weight, underlined, face, encoding); } wxFont(const wxNativeFontInfo& info, WXHFONT hFont = 0) { - Init(); - Create(info, hFont); } @@ -89,9 +82,6 @@ public: virtual ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual wxSize GetPixelSize() const; @@ -137,9 +127,6 @@ protected: virtual void DoSetNativeFontInfo(const wxNativeFontInfo& info); - // common part of all ctors - void Init(); - void Unshare(); private: diff --git a/include/wx/palmos/icon.h b/include/wx/palmos/icon.h index 397cc9bed7..1f838c5dec 100644 --- a/include/wx/palmos/icon.h +++ b/include/wx/palmos/icon.h @@ -44,9 +44,6 @@ public: // default wxIcon() { } - // copy - wxIcon(const wxIcon& icon) { Ref(icon); } - // from raw data wxIcon(const char bits[], int width, int height); @@ -68,8 +65,6 @@ public: long type = wxBITMAP_TYPE_ICO_RESOURCE, int desiredWidth = -1, int desiredHeight = -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 diff --git a/include/wx/palmos/metafile.h b/include/wx/palmos/metafile.h index 38b4b45cc9..333f460b99 100644 --- a/include/wx/palmos/metafile.h +++ b/include/wx/palmos/metafile.h @@ -44,7 +44,6 @@ class WXDLLEXPORT wxMetafile: public wxGDIObject { public: wxMetafile(const wxString& file = wxEmptyString); - wxMetafile(const wxMetafile& metafile) { Ref(metafile); } virtual ~wxMetafile(); // After this is called, the metafile cannot be used for anything @@ -69,8 +68,6 @@ public: void SetWindowsMappingMode(int mm); // Operators - wxMetafile& operator=(const wxMetafile& metafile) - { if (*this != metafile) Ref(metafile); return *this; } bool operator==(const wxMetafile& metafile) const { return m_refData == metafile.m_refData; } bool operator!=(const wxMetafile& metafile) const diff --git a/include/wx/palmos/palette.h b/include/wx/palmos/palette.h index 602d0f28f9..28e4109d20 100644 --- a/include/wx/palmos/palette.h +++ b/include/wx/palmos/palette.h @@ -34,7 +34,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: 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(void); @@ -44,7 +43,6 @@ public: 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; } diff --git a/include/wx/palmos/pen.h b/include/wx/palmos/pen.h index de6691ac2a..6c86bb8e9b 100644 --- a/include/wx/palmos/pen.h +++ b/include/wx/palmos/pen.h @@ -77,17 +77,8 @@ public: wxPen(); wxPen(const wxColour& col, int width = 1, int style = wxSOLID); wxPen(const wxBitmap& stipple, int width); - wxPen(const wxPen& pen) { Ref(pen); } virtual ~wxPen(); - wxPen& operator=(const wxPen& pen) - { - if ( this != &pen ) - Ref(pen); - - return *this; - } - bool operator==(const wxPen& pen) const { const wxPenRefData *penData = (wxPenRefData *)pen.m_refData; diff --git a/include/wx/palmos/region.h b/include/wx/palmos/region.h index 540fca45a9..c489ecfe06 100644 --- a/include/wx/palmos/region.h +++ b/include/wx/palmos/region.h @@ -56,12 +56,6 @@ public: virtual ~wxRegion(); - // Copying - wxRegion(const wxRegion& r) : wxGDIObject(r) - { Ref(r); } - wxRegion& operator = (const wxRegion& r) - { Ref(r); return (*this); } - // Modify region // ------------- diff --git a/include/wx/x11/bitmap.h b/include/wx/x11/bitmap.h index ad4f10e9e0..c25b55b8d7 100644 --- a/include/wx/x11/bitmap.h +++ b/include/wx/x11/bitmap.h @@ -78,11 +78,9 @@ public: wxBitmap( const char bits[], int width, int height, int depth = 1 ); wxBitmap( const char **bits ) { (void)CreateFromXpm(bits); } wxBitmap( char **bits ) { (void)CreateFromXpm((const char **)bits); } - wxBitmap( const wxBitmap& bmp ); wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM ); virtual ~wxBitmap(); - wxBitmap& operator = ( const wxBitmap& bmp ); bool operator == ( const wxBitmap& bmp ) const; bool operator != ( const wxBitmap& bmp ) const; bool Ok() const; diff --git a/include/wx/x11/brush.h b/include/wx/x11/brush.h index 1345c82305..c794e34416 100644 --- a/include/wx/x11/brush.h +++ b/include/wx/x11/brush.h @@ -35,9 +35,6 @@ public: wxBrush( const wxBitmap &stippleBitmap ); ~wxBrush(); - wxBrush( const wxBrush &brush ) { Ref(brush); } - wxBrush& operator = ( const wxBrush& brush ) { Ref(brush); return *this; } - bool Ok() const { return m_refData != NULL; } bool operator == ( const wxBrush& brush ) const; diff --git a/include/wx/x11/colour.h b/include/wx/x11/colour.h index e5735c3b2e..622b55e014 100644 --- a/include/wx/x11/colour.h +++ b/include/wx/x11/colour.h @@ -58,9 +58,6 @@ public: // Get colour from name or wxNullColour static wxColour CreateByName(const wxString& name); - wxColour( const wxColour& col ) { Ref(col); } - wxColour& operator = ( const wxColour& col ) { Ref(col); return *this; } - ~wxColour(); bool Ok() const { return m_refData != NULL; } diff --git a/include/wx/x11/cursor.h b/include/wx/x11/cursor.h index a98b2f0360..39a29e7e6d 100644 --- a/include/wx/x11/cursor.h +++ b/include/wx/x11/cursor.h @@ -28,7 +28,6 @@ public: wxCursor(); wxCursor( int cursorId ); - wxCursor( const wxCursor &cursor ); #if wxUSE_IMAGE wxCursor( const wxImage & image ); #endif @@ -36,7 +35,6 @@ public: int hotSpotX=-1, int hotSpotY=-1, const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0 ); ~wxCursor(); - wxCursor& operator = ( const wxCursor& cursor ); bool operator == ( const wxCursor& cursor ) const; bool operator != ( const wxCursor& cursor ) const; bool Ok() const; diff --git a/include/wx/x11/font.h b/include/wx/x11/font.h index bb37d93fec..fa9d1c9edb 100644 --- a/include/wx/x11/font.h +++ b/include/wx/x11/font.h @@ -19,8 +19,7 @@ class WXDLLIMPEXP_CORE wxFont : public wxFontBase { public: // ctors and such - wxFont() { Init(); } - wxFont(const wxFont& font) { Init(); Ref(font); } + wxFont() { } wxFont(int size, int family, @@ -30,8 +29,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -56,9 +53,6 @@ public: virtual ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; @@ -109,9 +103,6 @@ public: protected: virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); - // common part of all ctors - void Init(); - void Unshare(); private: diff --git a/include/wx/x11/icon.h b/include/wx/x11/icon.h index b9e749f2f8..50272abd03 100644 --- a/include/wx/x11/icon.h +++ b/include/wx/x11/icon.h @@ -22,7 +22,6 @@ class WXDLLIMPEXP_CORE wxIcon: public wxBitmap { public: wxIcon(); - wxIcon( const wxIcon& icon); wxIcon( const char **bits, int width=-1, int height=-1 ); // 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 !(*this == icon); } diff --git a/include/wx/x11/palette.h b/include/wx/x11/palette.h index c36269fbba..2054a9a128 100644 --- a/include/wx/x11/palette.h +++ b/include/wx/x11/palette.h @@ -51,7 +51,6 @@ class WXDLLEXPORT wxPalette: public wxPaletteBase public: wxPalette(); - wxPalette(const wxPalette& palette) { Ref(palette); } wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); ~wxPalette(); @@ -61,7 +60,6 @@ public: 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; } diff --git a/include/wx/x11/pen.h b/include/wx/x11/pen.h index 3103d77f25..17c2288831 100644 --- a/include/wx/x11/pen.h +++ b/include/wx/x11/pen.h @@ -38,9 +38,6 @@ public: wxPen( const wxBitmap &stipple, int width ); ~wxPen(); - wxPen( const wxPen& pen ) { Ref(pen); } - wxPen& operator = ( const wxPen& pen ) { Ref(pen); return *this; } - bool Ok() const { return m_refData != NULL; } bool operator == ( const wxPen& pen ) const; diff --git a/include/wx/x11/region.h b/include/wx/x11/region.h index b4c1ce349a..2dc28ecca0 100644 --- a/include/wx/x11/region.h +++ b/include/wx/x11/region.h @@ -82,9 +82,6 @@ public: ~wxRegion(); - wxRegion( const wxRegion& region ) { Ref(region); } - wxRegion& operator = ( const wxRegion& region ) { Ref(region); return *this; } - bool Ok() const { return m_refData != NULL; } bool operator == ( const wxRegion& region ) const; diff --git a/src/cocoa/font.cpp b/src/cocoa/font.cpp index dd538c4d8e..bb4a682cc5 100644 --- a/src/cocoa/font.cpp +++ b/src/cocoa/font.cpp @@ -32,10 +32,6 @@ wxFontRefData::~wxFontRefData() // TODO: delete font data } -void wxFont::Init() -{ -} - bool wxFont::Create(const wxNativeFontInfo&) { return FALSE; diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index 5eaa887e46..743667fa2a 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -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 { // either it is the same font, i.e. they share the same common data or they diff --git a/src/common/image.cpp b/src/common/image.cpp index 807bdd2890..125e97613a 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -148,17 +148,6 @@ wxImage::wxImage( wxInputStream& stream, const wxString& mimetype, int index ) } #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 ) { Create(xpmData); diff --git a/src/common/object.cpp b/src/common/object.cpp index f43f2b2d99..78f63ab0a8 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -283,15 +283,6 @@ wxObject *wxCreateDynamicObject(const wxChar *name) // 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) { #if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT diff --git a/src/generic/paletteg.cpp b/src/generic/paletteg.cpp index 24900fc538..6ccfde5439 100644 --- a/src/generic/paletteg.cpp +++ b/src/generic/paletteg.cpp @@ -66,23 +66,10 @@ wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green Create(n, red, green, blue); } -wxPalette::wxPalette(const wxPalette& palette) - : wxPaletteBase() -{ - Ref(palette); -} - wxPalette::~wxPalette() { } -wxPalette& wxPalette::operator = (const wxPalette& palette) -{ - if (*this == palette) return (*this); - Ref(palette); - return *this; -} - bool wxPalette::operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 7f0b385f9b..05ffe3b3d3 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -1143,12 +1143,6 @@ wxImage wxBitmap::ConvertToImage() const return image; } -wxBitmap::wxBitmap( const wxBitmap& bmp ) - : wxBitmapBase() -{ - Ref( bmp ); -} - wxBitmap::wxBitmap( const wxString &filename, wxBitmapType type ) { LoadFile( filename, type ); @@ -1180,14 +1174,6 @@ wxBitmap::~wxBitmap() { } -wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp ) -{ - if ( m_refData != bmp.m_refData ) - Ref( bmp ); - - return *this; -} - bool wxBitmap::operator == ( const wxBitmap& bmp ) const { return m_refData == bmp.m_refData; diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index f277f4b0c9..cac9e5aaba 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -153,13 +153,6 @@ wxCursor::wxCursor(const char bits[], int width, int height, gdk_bitmap_unref( mask ); } - -wxCursor::wxCursor( const wxCursor &cursor ) - : wxObject() -{ - Ref( cursor ); -} - #if wxUSE_IMAGE wxCursor::wxCursor( const wxImage & image ) @@ -320,16 +313,6 @@ wxCursor::~wxCursor() { } -wxCursor& wxCursor::operator = ( const wxCursor& cursor ) -{ - if (*this == cursor) - return (*this); - - Ref( cursor ); - - return *this; -} - bool wxCursor::operator == ( const wxCursor& cursor ) const { return m_refData == cursor.m_refData; diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 120d0a87e5..04da6ccac7 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -345,14 +345,8 @@ void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo& info) IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) -void wxFont::Init() -{ -} - wxFont::wxFont(const wxNativeFontInfo& info) { - Init(); - Create( info.GetPointSize(), info.GetFamily(), info.GetStyle(), diff --git a/src/gtk/icon.cpp b/src/gtk/icon.cpp index 776adeb423..0d82d6830b 100644 --- a/src/gtk/icon.cpp +++ b/src/gtk/icon.cpp @@ -32,18 +32,6 @@ wxIcon::wxIcon() : wxBitmap() { } -wxIcon::wxIcon( const wxIcon& icon ) : wxBitmap() -{ - Ref(icon); -} - -wxIcon& wxIcon::operator = ( const wxIcon& icon ) -{ - if (*this == icon) return (*this); - Ref(icon); - return *this; -} - void wxIcon::CopyFromBitmap(const wxBitmap& bmp) { wxIcon *icon = (wxIcon*)(&bmp); diff --git a/src/mac/carbon/colour.cpp b/src/mac/carbon/colour.cpp index 9fcb7c04fb..864bd6f749 100644 --- a/src/mac/carbon/colour.cpp +++ b/src/mac/carbon/colour.cpp @@ -37,29 +37,6 @@ void wxColour::Init() wxComposeRGBColor( &m_pixel, m_red, m_blue, m_green ); } -wxColour::wxColour (const wxColour& col) - : wxObject() -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - - memcpy( &m_pixel, &col.m_pixel, 6 ); -} - -wxColour& wxColour::operator =(const wxColour& col) -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - - memcpy( &m_pixel, &col.m_pixel, 6 ); - - return *this; -} - void wxColour::InitFromName(const wxString& name) { if ( wxTheColourDatabase ) diff --git a/src/mac/carbon/font.cpp b/src/mac/carbon/font.cpp index 517f232e70..47ceb2e5b1 100644 --- a/src/mac/carbon/font.cpp +++ b/src/mac/carbon/font.cpp @@ -372,10 +372,6 @@ void wxFontRefData::MacFindFont() // wxFont // ---------------------------------------------------------------------------- -void wxFont::Init() -{ -} - bool wxFont::Create(const wxNativeFontInfo& info) { return Create( diff --git a/src/mac/classic/font.cpp b/src/mac/classic/font.cpp index d38a241ea0..ad7abbaaf3 100644 --- a/src/mac/classic/font.cpp +++ b/src/mac/classic/font.cpp @@ -228,9 +228,6 @@ void wxFontRefData::MacFindFont() // ---------------------------------------------------------------------------- // wxFont // ---------------------------------------------------------------------------- - -void wxFont::Init() -{ } bool wxFont::Create(const wxNativeFontInfo& info) diff --git a/src/mgl/bitmap.cpp b/src/mgl/bitmap.cpp index 56a422cc0f..3fdab5fe9c 100644 --- a/src/mgl/bitmap.cpp +++ b/src/mgl/bitmap.cpp @@ -355,11 +355,6 @@ wxImage wxBitmap::ConvertToImage() const return image; } -wxBitmap::wxBitmap(const wxBitmap& bmp) -{ - Ref(bmp); -} - wxBitmap::wxBitmap(const wxString &filename, wxBitmapType type) { LoadFile(filename, type); @@ -379,13 +374,6 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) delete bdc; } -wxBitmap& wxBitmap::operator = (const wxBitmap& bmp) -{ - if ( *this == bmp ) return (*this); - Ref(bmp); - return *this; -} - bool wxBitmap::operator == (const wxBitmap& bmp) const { return (m_refData == bmp.m_refData); diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp index 7a26b387a5..039d7ef4f5 100644 --- a/src/mgl/brush.cpp +++ b/src/mgl/brush.cpp @@ -143,18 +143,6 @@ wxBrush::wxBrush(const wxBitmap &stippleBitmap) M_BRUSHDATA->m_style = wxSTIPPLE; } -wxBrush::wxBrush(const wxBrush &brush) -{ - Ref(brush); -} - -wxBrush& wxBrush::operator = (const wxBrush& brush) -{ - if (*this == brush) return (*this); - Ref(brush); - return *this; -} - bool wxBrush::operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index d2334ba0d2..b2a4c69a7c 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -167,24 +167,11 @@ wxCursor::wxCursor(const wxString& cursor_file, } } -wxCursor::wxCursor(const wxCursor &cursor) -{ - Ref(cursor); -} - wxCursor::~wxCursor() { // wxObject unrefs data } -wxCursor& wxCursor::operator = (const wxCursor& cursor) -{ - if ( *this == cursor ) - return (*this); - Ref(cursor); - return *this; -} - bool wxCursor::operator == (const wxCursor& cursor) const { return (m_refData == cursor.m_refData); diff --git a/src/mgl/icon.cpp b/src/mgl/icon.cpp index 5af736371a..d1e2175fdb 100644 --- a/src/mgl/icon.cpp +++ b/src/mgl/icon.cpp @@ -31,19 +31,6 @@ wxIcon::wxIcon(char **bits, int WXUNUSED(width), int WXUNUSED(height)) : { } -wxIcon::wxIcon(const wxIcon& icon) : wxBitmap() -{ - Ref(icon); -} - -wxIcon& wxIcon::operator = (const wxIcon& icon) -{ - if (*this == icon) - return (*this); - Ref(icon); - return *this; -} - void wxIcon::CopyFromBitmap(const wxBitmap& bmp) { wxIcon *icon = (wxIcon*)(&bmp); diff --git a/src/mgl/palette.cpp b/src/mgl/palette.cpp index a21e74e104..e47260ed12 100644 --- a/src/mgl/palette.cpp +++ b/src/mgl/palette.cpp @@ -59,22 +59,10 @@ wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green Create(n, red, green, blue); } -wxPalette::wxPalette(const wxPalette& palette) -{ - Ref(palette); -} - wxPalette::~wxPalette() { } -wxPalette& wxPalette::operator = (const wxPalette& palette) -{ - if (*this == palette) return (*this); - Ref(palette); - return *this; -} - bool wxPalette::operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; diff --git a/src/mgl/pen.cpp b/src/mgl/pen.cpp index 5e125c2d03..a98e011a9e 100644 --- a/src/mgl/pen.cpp +++ b/src/mgl/pen.cpp @@ -103,18 +103,6 @@ wxPen::wxPen(const wxBitmap& stipple, int width) wxBitmapToPixPattern(stipple, &(M_PENDATA->m_pixPattern), NULL); } -wxPen::wxPen(const wxPen& pen) -{ - Ref(pen); -} - -wxPen& wxPen::operator = (const wxPen& pen) -{ - if (*this == pen) return (*this); - Ref(pen); - return *this; -} - bool wxPen::operator == (const wxPen& pen) const { return m_refData == pen.m_refData; diff --git a/src/motif/font.cpp b/src/motif/font.cpp index abfa867eb0..07d193cb74 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -215,15 +215,9 @@ wxFontRefData::~wxFontRefData() wxFont::wxFont(const wxNativeFontInfo& info) { - Init(); - (void)Create(info.GetXFontName()); } -void wxFont::Init() -{ -} - bool wxFont::Create(int pointSize, int family, int style, diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 4477a07b19..2f96e67b5e 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -241,12 +241,6 @@ void wxBitmapRefData::Free() // wxBitmap creation // ---------------------------------------------------------------------------- -// this function should be called from all wxBitmap ctors -void wxBitmap::Init() -{ - // m_refData = NULL; done in the base class ctor -} - wxGDIImageRefData *wxBitmap::CreateData() const { return new wxBitmapRefData; @@ -416,8 +410,6 @@ wxBitmap::~wxBitmap() wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) { - Init(); - #ifndef __WXMICROWIN__ wxBitmapRefData *refData = new wxBitmapRefData; m_refData = refData; @@ -484,8 +476,6 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) bool wxBitmap::CreateFromXpm(const char **data) { #if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB - Init(); - wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") ) wxXPMDecoder decoder; @@ -502,29 +492,21 @@ bool wxBitmap::CreateFromXpm(const char **data) wxBitmap::wxBitmap(int w, int h, int d) { - Init(); - (void)Create(w, h, d); } wxBitmap::wxBitmap(int w, int h, const wxDC& dc) { - Init(); - (void)Create(w, h, dc); } wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth) { - Init(); - (void)Create(data, type, width, height, depth); } wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type) { - Init(); - LoadFile(filename, (int)type); } diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index e377793c1c..cf939a5ff2 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -243,16 +243,6 @@ wxBrush::~wxBrush() // wxBrush house keeping stuff // ---------------------------------------------------------------------------- -wxBrush& wxBrush::operator=(const wxBrush& brush) -{ - if ( this != &brush ) - { - Ref(brush); - } - - return *this; -} - bool wxBrush::operator==(const wxBrush& brush) const { const wxBrushRefData *brushData = (wxBrushRefData *)brush.m_refData; diff --git a/src/msw/colour.cpp b/src/msw/colour.cpp index 5ef30bb4d0..af6adf93be 100644 --- a/src/msw/colour.cpp +++ b/src/msw/colour.cpp @@ -80,22 +80,6 @@ void wxColour::Init() m_green = 0; } -wxColour::wxColour(const wxColour& col) - :wxObject() -{ - *this = col; -} - -wxColour& wxColour::operator=(const wxColour& col) -{ - m_red = col.m_red; - m_green = col.m_green; - m_blue = col.m_blue; - m_isInit = col.m_isInit; - m_pixel = col.m_pixel; - return *this; -} - void wxColour::InitFromName(const wxString& name) { if ( wxTheColourDatabase ) diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 184ce8ba50..059e4bdb59 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -760,10 +760,6 @@ wxString wxNativeFontInfo::ToString() const // wxFont // ---------------------------------------------------------------------------- -void wxFont::Init() -{ -} - bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont) { UnRef(); diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 18dcce67b7..6c7507082e 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -860,10 +860,6 @@ wxString wxNativeFontInfo::ToString() const // wxFont // ---------------------------------------------------------------------------- -void wxFont::Init() -{ -} // end of wxFont::Init - bool wxFont::Create( const wxNativeFontInfo& rInfo, WXHFONT hFont ) { diff --git a/src/palmos/brush.cpp b/src/palmos/brush.cpp index a87d4b1f6d..3df9bd8483 100644 --- a/src/palmos/brush.cpp +++ b/src/palmos/brush.cpp @@ -65,11 +65,6 @@ wxBrush::~wxBrush() // wxBrush house keeping stuff // ---------------------------------------------------------------------------- -wxBrush& wxBrush::operator=(const wxBrush& brush) -{ - return *this; -} - bool wxBrush::operator==(const wxBrush& brush) const { return false; diff --git a/src/palmos/font.cpp b/src/palmos/font.cpp index d75397c30e..3f1f84d7b6 100644 --- a/src/palmos/font.cpp +++ b/src/palmos/font.cpp @@ -363,10 +363,6 @@ void wxNativeFontInfo::SetPixelSize(const wxSize& pixelSize) // wxFont // ---------------------------------------------------------------------------- -void wxFont::Init() -{ -} - bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont) { return false; diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 2c69e1b135..ec2c314c4e 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -902,11 +902,6 @@ wxImage wxBitmap::ConvertToImage() const // wxUSE_NANOX } -wxBitmap::wxBitmap( const wxBitmap& bmp ) -{ - Ref( bmp ); -} - wxBitmap::wxBitmap( const wxString &filename, wxBitmapType type ) { LoadFile( filename, type ); @@ -923,14 +918,6 @@ wxBitmap::~wxBitmap() { } -wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp ) -{ - if ( m_refData != bmp.m_refData ) - Ref( bmp ); - - return *this; -} - bool wxBitmap::operator == ( const wxBitmap& bmp ) const { return m_refData == bmp.m_refData; diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index 7a59872ca1..0635c03de7 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -124,12 +124,6 @@ wxCursor::wxCursor(const char bits[], int width, int height, wxFAIL_MSG( wxT("wxCursor creation from bits not yet implemented") ); } - -wxCursor::wxCursor( const wxCursor &cursor ) -{ - Ref( cursor ); -} - #if wxUSE_IMAGE wxCursor::wxCursor( const wxImage & image ) { @@ -141,16 +135,6 @@ wxCursor::~wxCursor() { } -wxCursor& wxCursor::operator = ( const wxCursor& cursor ) -{ - if (*this == cursor) - return (*this); - - Ref( cursor ); - - return *this; -} - bool wxCursor::operator == ( const wxCursor& cursor ) const { return m_refData == cursor.m_refData; diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 53d2bebcca..08742ac42e 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -522,14 +522,8 @@ void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo& info) // wxFont // ---------------------------------------------------------------------------- -void wxFont::Init() -{ -} - wxFont::wxFont(const wxNativeFontInfo& info) { - Init(); - #if wxUSE_UNICODE Create( info.GetPointSize(), info.GetFamily(), diff --git a/src/x11/icon.cpp b/src/x11/icon.cpp index b74a3ca7d6..1d428034e6 100644 --- a/src/x11/icon.cpp +++ b/src/x11/icon.cpp @@ -34,18 +34,6 @@ wxIcon::wxIcon() : wxBitmap() { } -wxIcon::wxIcon( const wxIcon& icon ) : wxBitmap() -{ - Ref(icon); -} - -wxIcon& wxIcon::operator = ( const wxIcon& icon ) -{ - if (*this == icon) return (*this); - Ref(icon); - return *this; -} - void wxIcon::CopyFromBitmap(const wxBitmap& bmp) { wxIcon *icon = (wxIcon*)(&bmp); -- 2.45.2