]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dynarray.cpp
Added inline setters for wxTreeEvent so we don't need to add new
[wxWidgets.git] / src / common / dynarray.cpp
index c6890ce3a09c4cd44bf7889b6d84e1081b0067b3..2b185f156f4f91f3ff4230645073df0c4f199e37 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     12.09.97
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -283,7 +283,10 @@ int name::Index(T lItem, CMPFUNC fnCompare) const                           \
 {                                                                           \
     size_t n = IndexForInsert(lItem, fnCompare);                            \
                                                                             \
-    return n < m_nCount && m_pItems[n] == lItem ? (int)n : wxNOT_FOUND;     \
+    return (n >= m_nCount ||                                                \
+           (*fnCompare)((const void *)(long)lItem,                          \
+                        ((const void *)(long)m_pItems[n]))) ? wxNOT_FOUND   \
+                                                            : (int)n;       \
 }                                                                           \
                                                                             \
 /* add item at the end */                                                   \