Fix bug in BaseGrid::GetSelection that resulted in row 0 always being selected

Originally committed to SVN as r5653.
This commit is contained in:
Thomas Goyne 2011-09-28 19:50:41 +00:00
parent bb72ec980e
commit 5a49abb2eb
1 changed files with 2 additions and 1 deletions

View File

@ -345,7 +345,8 @@ int BaseGrid::GetFirstSelRow() const {
} }
wxArrayInt BaseGrid::GetSelection() const { wxArrayInt BaseGrid::GetSelection() const {
wxArrayInt res(selection.size()); wxArrayInt res;
res.reserve(selection.size());
transform(selection.begin(), selection.end(), std::back_inserter(res), transform(selection.begin(), selection.end(), std::back_inserter(res),
bind(&BaseGrid::GetDialogueIndex, this, std::tr1::placeholders::_1)); bind(&BaseGrid::GetDialogueIndex, this, std::tr1::placeholders::_1));
std::sort(res.begin(), res.end()); std::sort(res.begin(), res.end());