# HG changeset patch # User Chris Cannam # Date 1214484083 0 # Node ID 113cf8781bd12bc457343bdeebb256b674d78b0f # Parent 9e1e12d1fbc38219d9ade7204337aedf57d42015 * Fix two problems reported by Matthias in the data editor window: - highlighted row was incorrect (it was highlighting the row for the next item after the current position, not the one before it as it should be) - making a row current moved the centre frame of the view, but did not change the playback position as it should do diff -r 9e1e12d1fbc3 -r 113cf8781bd1 data/model/SparseModel.h --- a/data/model/SparseModel.h Thu Jun 19 15:11:28 2008 +0000 +++ b/data/model/SparseModel.h Thu Jun 26 12:41:23 2008 +0000 @@ -286,7 +286,11 @@ if (m_rows.empty()) rebuildRowVector(); std::vector::iterator i = std::lower_bound(m_rows.begin(), m_rows.end(), frame); - return std::distance(m_rows.begin(), i); + int row = std::distance(m_rows.begin(), i); + if (i != m_rows.begin() && (i == m_rows.end() || *i != frame)) { + --row; + } + return row; } virtual int getColumnCount() const { return 1; }