From a1abd1a923027a33fb67c0050c950081df63c612 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 19 Feb 2009 20:26:00 +0000 Subject: [PATCH] Make wxImageList not copiable (fixes #10503), replace wxList with wxObjectList git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/imaglist.h | 4 ++-- include/wx/msw/imaglist.h | 2 +- src/generic/imaglist.cpp | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/wx/generic/imaglist.h b/include/wx/generic/imaglist.h index 4d42a170d1..1c18dfc9a2 100644 --- a/include/wx/generic/imaglist.h +++ b/include/wx/generic/imaglist.h @@ -49,12 +49,12 @@ public: // Internal use only const wxBitmap *GetBitmapPtr(int index) const; private: - wxList m_images; + wxObjectList m_images; int m_width; int m_height; - DECLARE_DYNAMIC_CLASS(wxGenericImageList) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList) }; #ifndef wxHAS_NATIVE_IMAGELIST diff --git a/include/wx/msw/imaglist.h b/include/wx/msw/imaglist.h index c76ce168cc..73fc9df729 100644 --- a/include/wx/msw/imaglist.h +++ b/include/wx/msw/imaglist.h @@ -199,7 +199,7 @@ public: protected: WXHIMAGELIST m_hImageList; - DECLARE_DYNAMIC_CLASS(wxImageList) + DECLARE_DYNAMIC_CLASS_NO_COPY(wxImageList) }; #endif diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 61fb228a2e..87240c8aa2 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -120,7 +120,7 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const { - wxList::compatibility_iterator node = m_images.Item( index ); + wxObjectList::compatibility_iterator node = m_images.Item( index ); wxCHECK_MSG( node, NULL, wxT("wrong index in image list") ); @@ -153,7 +153,7 @@ wxIcon wxGenericImageList::GetIcon(int index) const bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) { - wxList::compatibility_iterator node = m_images.Item( index ); + wxObjectList::compatibility_iterator node = m_images.Item( index ); wxCHECK_MSG( node, false, wxT("wrong index in image list") ); @@ -175,7 +175,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) } else { - wxList::compatibility_iterator next = node->GetNext(); + wxObjectList::compatibility_iterator next = node->GetNext(); delete node->GetData(); m_images.Erase( node ); m_images.Insert( next, newBitmap ); @@ -186,7 +186,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) { - wxList::compatibility_iterator node = m_images.Item( index ); + wxObjectList::compatibility_iterator node = m_images.Item( index ); wxCHECK_MSG( node, false, wxT("wrong index in image list") ); @@ -208,7 +208,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBit } else { - wxList::compatibility_iterator next = node->GetNext(); + wxObjectList::compatibility_iterator next = node->GetNext(); delete node->GetData(); m_images.Erase( node ); m_images.Insert( next, newBitmap ); @@ -222,7 +222,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBit bool wxGenericImageList::Remove( int index ) { - wxList::compatibility_iterator node = m_images.Item( index ); + wxObjectList::compatibility_iterator node = m_images.Item( index ); wxCHECK_MSG( node, false, wxT("wrong index in image list") ); @@ -234,7 +234,7 @@ bool wxGenericImageList::Remove( int index ) bool wxGenericImageList::RemoveAll() { - WX_CLEAR_LIST(wxList, m_images); + WX_CLEAR_LIST(wxObjectList, m_images); m_images.Clear(); return true; @@ -245,7 +245,7 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const width = 0; height = 0; - wxList::compatibility_iterator node = m_images.Item( index ); + wxObjectList::compatibility_iterator node = m_images.Item( index ); wxCHECK_MSG( node, false, wxT("wrong index in image list") ); @@ -259,7 +259,7 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, int flags, bool WXUNUSED(solidBackground) ) { - wxList::compatibility_iterator node = m_images.Item( index ); + wxObjectList::compatibility_iterator node = m_images.Item( index ); wxCHECK_MSG( node, false, wxT("wrong index in image list") ); -- 2.45.2