fix for issue #428

This commit is contained in:
ErrorFlynn 2019-05-05 11:13:08 -04:00 committed by GitHub
parent e36a3270e9
commit 4e3641ed88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1198,23 +1198,15 @@ namespace nana
return{};
}
/// return a ref to the real item object at display!!! position pos using current sorting only if it is active, and at absolute position if no sorting is currently active.
/// return a ref to the real item object at display position
category_t::container::value_type& at(const index_pair& pos)
{
auto acc_pos = pos.item;
if (npos != sort_attrs_.column)
acc_pos = index_cast(pos, true).item; //convert display position to absolute position
return get(pos.cat)->items.at(acc_pos);
return get(pos.cat)->items.at(index_cast(pos, true).item);
}
const category_t::container::value_type& at(const index_pair& pos) const
{
auto acc_pos = pos.item;
if (npos != sort_attrs_.column)
acc_pos = index_cast(pos, true).item; //convert display position to absolute position
return get(pos.cat)->items.at(acc_pos);
return get(pos.cat)->items.at(index_cast(pos, true).item);
}
std::vector<cell> at_model(const index_pair& pos) const