]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxArray::Index() with bFromEnd=true in STL build.
authorVáclav Slavík <vslavik@fastmail.fm>
Sat, 5 Nov 2011 15:20:32 +0000 (15:20 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sat, 5 Nov 2011 15:20:32 +0000 (15:20 +0000)
This function incorrectly returned index from the end of the array when
searching from the end. Fixed to work as the non-STL version.

Fixes #13626.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dynarray.h

index 56abaae013f4d8fbdee8f0f99684b219f96ffc09..d50c7c19e874699b6a887f8eb4ca7ae10c1f8ed8 100644 (file)
@@ -151,7 +151,7 @@ public:                                                             \
                                        e = rend();                  \
           for ( const_reverse_iterator i = b; i != e; ++i )         \
               if ( *i == item )                                     \
-                  return (int)(i - b);                              \
+                  return (int)(e - i - 1);                          \
       }                                                             \
       else                                                          \
       {                                                             \