From: Václav Slavík Date: Sat, 5 Nov 2011 15:20:32 +0000 (+0000) Subject: Fix wxArray::Index() with bFromEnd=true in STL build. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/12a7fb5f0bfa6a6c9b5634eca3144490d6403aca Fix wxArray::Index() with bFromEnd=true in STL build. 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 --- diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 56abaae013..d50c7c19e8 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -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 \ { \