From a2a3518b71c8fe521435875753aae6de5f4c02c4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 30 Oct 2018 02:05:52 +0100 Subject: [PATCH] Also remove wxImageList::Replace(wxIcon) overload from wxOSX This one is harmless, unless Add() overload removed by the previous commit, but still unnecessary. --- include/wx/osx/imaglist.h | 1 - src/osx/imaglist.cpp | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/include/wx/osx/imaglist.h b/include/wx/osx/imaglist.h index fdab2447bd..42ef66377f 100644 --- a/include/wx/osx/imaglist.h +++ b/include/wx/osx/imaglist.h @@ -37,7 +37,6 @@ public: int Add( const wxBitmap& bitmap, const wxColour& maskColour ); wxBitmap GetBitmap(int index) const; wxIcon GetIcon(int index) const; - bool Replace( int index, const wxIcon &bitmap ); bool Replace( int index, const wxBitmap &bitmap ); bool Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ); bool Remove( int index ); diff --git a/src/osx/imaglist.cpp b/src/osx/imaglist.cpp index d487bd8bc6..863e8ce6ba 100644 --- a/src/osx/imaglist.cpp +++ b/src/osx/imaglist.cpp @@ -165,31 +165,6 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap ) return true; } -bool wxImageList::Replace( int index, const wxIcon &bitmap ) -{ - wxList::compatibility_iterator node = m_images.Item( index ); - - wxCHECK_MSG( node, false, wxT("wrong index in image list") ); - - wxIcon* newBitmap = new wxIcon( bitmap ); - - if (index == (int) m_images.GetCount() - 1) - { - delete node->GetData(); - m_images.Erase( node ); - m_images.Append( newBitmap ); - } - else - { - wxList::compatibility_iterator next = node->GetNext(); - delete node->GetData(); - m_images.Erase( node ); - m_images.Insert( next, newBitmap ); - } - - return true; -} - bool wxImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) { wxList::compatibility_iterator node = m_images.Item( index );