fixed return code checking in wxImageList::Replace() (bug 1380664)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Dec 2005 18:56:15 +0000 (18:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 14 Dec 2005 18:56:15 +0000 (18:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/imaglist.cpp

index 39c071e1fdb390225b75e52737062fdc351d48aa..b873175b9bbfaab2eff58f70eb00a9620f2a4e98 100644 (file)
@@ -210,7 +210,7 @@ bool wxImageList::Replace(int index,
 // Replaces a bitmap and mask from an icon.
 bool wxImageList::Replace(int i, const wxIcon& icon)
 {
-    bool ok = ImageList_ReplaceIcon(GetHImageList(), i, GetHiconOf(icon)) != 0;
+    bool ok = ImageList_ReplaceIcon(GetHImageList(), i, GetHiconOf(icon)) != -1;
     if ( !ok )
     {
         wxLogLastError(wxT("ImageList_ReplaceIcon()"));