From 835b3ce14562542ec49a3563ec603fd8321bc9fd Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 22 Mar 2015 02:56:03 +0100 Subject: [PATCH] FIX: return self pos (= *i ) --- source/gui/widgets/listbox.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index cb45040a..837af8b3 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -841,8 +841,11 @@ namespace nana if (pos >= catobj.sorted.size()) throw std::out_of_range("listbox: Invalid item position."); - auto i = std::find(catobj.sorted.begin(), catobj.sorted.end(), pos); - return (i != catobj.sorted.end() ? *i : npos); + for (size_type i=0; i