]> git.saurik.com Git - wxWidgets.git/commitdiff
return index of first added image in Add(), like MSW does, #10013
authorPaul Cornett <paulcor@bullseye.com>
Mon, 12 Jan 2009 05:39:04 +0000 (05:39 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Mon, 12 Jan 2009 05:39:04 +0000 (05:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/imaglist.cpp

index 72eb445d73d312dd5c2ca4496992b8d9d4da6fad..b285c15935b817ddef0357887e79198ec4fbe272 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        src/generic/imaglist.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -68,6 +68,8 @@ int wxGenericImageList::Add( const wxBitmap &bitmap )
                   _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 ) );
@@ -98,7 +100,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap )
         m_height = bitmap.GetHeight();
     }
 
-    return m_images.GetCount()-1;
+    return index;
 }
 
 int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )