SVN commit 1017926 by hedlund: Backport of fix for bug 205606. M +6 -5 kwqcommands.cpp --- branches/KDE/4.3/kdeedu/kwordquiz/src/kwqcommands.cpp #1017925:1017926 @@ -167,15 +167,15 @@ while (i < sl.count() && br <= view()->model()->rowCount(QModelIndex())) { ac = lc; - sr = sl.at(i).split('\t', QString::SkipEmptyParts); + sr = sl.at(i).split('\t'); int c = 0; while (ac <= rc) { IndexAndData id; id.index = view()->model()->index(ar, ac); id.data = view()->model()->data(id.index, Qt::DisplayRole); m_pasteIndexAndData.append(id); - - view()->model()->setData(id.index, QVariant(sr[c]), Qt::EditRole); + if (c < sr.count()) + view()->model()->setData(id.index, QVariant(sr[c]), Qt::EditRole); view()->selectionModel()->select(id.index, QItemSelectionModel::Select); ac++; c++; @@ -189,11 +189,12 @@ while (i < sl.count() && ar <= br) { ac = lc; - sr = sl.at(i).split('\t', QString::SkipEmptyParts); + sr = sl.at(i).split('\t'); int c = 0; while (ac <= rc) { if (view()->selectionModel()->isSelected(view()->model()->index(ar, ac))) - view()->model()->setData(view()->model()->index(ar, ac), QVariant(sr[c]), Qt::EditRole); + if (c < sr.count()) + view()->model()->setData(view()->model()->index(ar, ac), QVariant(sr[c]), Qt::EditRole); ac++; c++; }