From e0f5b49a0767df2288368f167afd8e1a225c36fb Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 20 Jul 2015 21:50:30 +0200 Subject: [PATCH] Fixed searching the elements in wxArrayPGProperty. Use dedicated Index() function to search elements in wxArray instead of calling custom function. --- include/wx/propgrid/propgriddefs.h | 13 ------------- src/propgrid/property.cpp | 2 +- src/propgrid/propgrid.cpp | 15 +++++++++++++++ src/propgrid/propgridpagestate.cpp | 5 +---- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index d6e1c79214..ca6a5e6d23 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -321,19 +321,6 @@ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxObject*, wxArrayPGObject, wxBaseArrayPtrVoid, class WXDLLIMPEXP_PROPGRID); -// Utility to find if specific item is in a vector. Returns index to -// the item, or wxNOT_FOUND if not present. -template -int wxPGFindInVector( CONTAINER vector, const T& item ) -{ - for ( unsigned int i=0; i(p)); } bool wxPGProperty::ValidateValue( wxVariant& WXUNUSED(value), wxPGValidationInfo& WXUNUSED(validationInfo) ) const diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 5937dc77c1..8ed706f8e3 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5621,6 +5621,21 @@ void wxPropertyGrid::ClearActionTriggers( int action ) while ( didSomething ); } +#if WXWIN_COMPATIBILITY_3_0 +// Utility to find if specific item is in a vector. Returns index to +// the item, or wxNOT_FOUND if not present. +template +int wxPGFindInVector( CONTAINER vector, const T& item ) +{ + for ( unsigned int i=0; i