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/
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);
}