FIX: return self pos (= *i )

This commit is contained in:
qPCR4vir 2015-03-22 02:56:03 +01:00
parent f93c71ed80
commit 835b3ce145

View File

@ -841,8 +841,11 @@ namespace nana
if (pos >= catobj.sorted.size()) if (pos >= catobj.sorted.size())
throw std::out_of_range("listbox: Invalid item position."); throw std::out_of_range("listbox: Invalid item position.");
auto i = std::find(catobj.sorted.begin(), catobj.sorted.end(), pos); for (size_type i=0; i<catobj.sorted.size();++i)
return (i != catobj.sorted.end() ? *i : npos); if (pos==catobj.sorted[i])
return i;
return npos ;
} }
category_t::container::value_type& at(const index_pair& pos) category_t::container::value_type& at(const index_pair& pos)