From 8628b7d4139d1fa2ab60b254a1a346008d4a9123 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 10 Feb 2006 15:41:06 +0000 Subject: [PATCH] GTK1 fixes after wxObject-derived classes copy ctors/assignment operators simplifications (patch 1428863) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk1/bitmap.h | 2 -- include/wx/gtk1/brush.h | 5 ----- include/wx/gtk1/colour.h | 6 ------ include/wx/gtk1/cursor.h | 2 -- include/wx/gtk1/font.h | 13 +------------ include/wx/gtk1/icon.h | 2 -- include/wx/gtk1/pen.h | 5 ----- include/wx/gtk1/region.h | 5 ----- src/gtk1/bitmap.cpp | 14 -------------- src/gtk1/cursor.cpp | 17 ----------------- src/gtk1/font.cpp | 6 ------ src/gtk1/icon.cpp | 12 ------------ 12 files changed, 1 insertion(+), 88 deletions(-) diff --git a/include/wx/gtk1/bitmap.h b/include/wx/gtk1/bitmap.h index 8168c9a9d8..8640396da0 100644 --- a/include/wx/gtk1/bitmap.h +++ b/include/wx/gtk1/bitmap.h @@ -69,11 +69,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/gtk1/brush.h b/include/wx/gtk1/brush.h index ecdfe46398..eb425d067e 100644 --- a/include/wx/gtk1/brush.h +++ b/include/wx/gtk1/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/gtk1/colour.h b/include/wx/gtk1/colour.h index dab437e7b3..7bd893b322 100644 --- a/include/wx/gtk1/colour.h +++ b/include/wx/gtk1/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/gtk1/cursor.h b/include/wx/gtk1/cursor.h index 67eabdb5de..963a26182d 100644 --- a/include/wx/gtk1/cursor.h +++ b/include/wx/gtk1/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/gtk1/font.h b/include/wx/gtk1/font.h index 3f7611781f..ca0c71af87 100644 --- a/include/wx/gtk1/font.h +++ b/include/wx/gtk1/font.h @@ -30,14 +30,11 @@ 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 +48,6 @@ public: const wxString& face = wxEmptyString, wxFontEncoding encoding = wxFONTENCODING_DEFAULT) { - Init(); - (void)Create(size, family, style, weight, underlined, face, encoding); } @@ -69,9 +64,6 @@ public: ~wxFont(); - // assignment - wxFont& operator=(const wxFont& font); - // implement base class pure virtuals virtual int GetPointSize() const; virtual int GetFamily() const; @@ -104,9 +96,6 @@ public: protected: virtual void DoSetNativeFontInfo( const wxNativeFontInfo& info ); - // common part of all ctors - void Init(); - private: DECLARE_DYNAMIC_CLASS(wxFont) }; diff --git a/include/wx/gtk1/icon.h b/include/wx/gtk1/icon.h index 38019ae2ef..f93b45ac12 100644 --- a/include/wx/gtk1/icon.h +++ b/include/wx/gtk1/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/gtk1/pen.h b/include/wx/gtk1/pen.h index aef9877563..fe95ad1003 100644 --- a/include/wx/gtk1/pen.h +++ b/include/wx/gtk1/pen.h @@ -40,11 +40,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/gtk1/region.h b/include/wx/gtk1/region.h index 5319f14975..217b37195f 100644 --- a/include/wx/gtk1/region.h +++ b/include/wx/gtk1/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/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index f8e9bd35ee..8237eaa338 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -1038,12 +1038,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 ); @@ -1075,14 +1069,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/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index f277f4b0c9..cac9e5aaba 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/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/gtk1/font.cpp b/src/gtk1/font.cpp index 35a7060ab6..4d3e493fdd 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -474,14 +474,8 @@ void wxFontRefData::SetNativeFontInfo(const wxNativeFontInfo& info) IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) -void wxFont::Init() -{ -} - wxFont::wxFont(const wxNativeFontInfo& info) { - Init(); - (void) Create(info.GetXFontName()); } diff --git a/src/gtk1/icon.cpp b/src/gtk1/icon.cpp index 776adeb423..0d82d6830b 100644 --- a/src/gtk1/icon.cpp +++ b/src/gtk1/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); -- 2.45.2