diff options
| author | Frank Reininghaus <[email protected]> | 2013-08-04 21:46:08 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-08-04 21:46:08 +0200 |
| commit | bedf1db916ae80a3c27062cbd86f476d166fd51c (patch) | |
| tree | ac751669cd31e660e6023acc493f2c780358aff8 /src | |
| parent | 6467358eeffca2e5888e83c4fbeb995e60c53ada (diff) | |
Fix possible out of range error inKItemListSizeHintResolver::itemsMoved
The function assumes implicitly that the moved range always starts with
the index 0. This is indeed the case at the moment, but it might make
sense to change that in the future. This commit prevents that we get an
out of range problem then.
Thanks to Emmanuel Pescosta for finding this problem, see
https://git.reviewboard.kde.org/r/111808/
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/private/kitemlistsizehintresolver.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/private/kitemlistsizehintresolver.cpp b/src/kitemviews/private/kitemlistsizehintresolver.cpp index e44630243..c86ce2bf8 100644 --- a/src/kitemviews/private/kitemlistsizehintresolver.cpp +++ b/src/kitemviews/private/kitemlistsizehintresolver.cpp @@ -120,7 +120,7 @@ void KItemListSizeHintResolver::itemsMoved(const KItemRange& range, const QList< const int movedRangeEnd = range.index + range.count; for (int i = range.index; i < movedRangeEnd; ++i) { - const int newIndex = movedToIndexes.at(i); + const int newIndex = movedToIndexes.at(i - range.index); newSizeHintCache[newIndex] = m_sizeHintCache.at(i); } |
