git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58031 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
 // Name:        src/generic/imaglist.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Name:        src/generic/imaglist.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
                   _T("invalid bitmap size in wxImageList: this might work ")
                   _T("on this platform but definitely won't under Windows.") );
 
                   _T("invalid bitmap size in wxImageList: this might work ")
                   _T("on this platform but definitely won't under Windows.") );
 
+    const int index = int(m_images.GetCount());
+
     if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
     {
         m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
     if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
     {
         m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
         m_height = bitmap.GetHeight();
     }
 
         m_height = bitmap.GetHeight();
     }
 
-    return m_images.GetCount()-1;
 }
 
 int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )
 }
 
 int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )