From kde-commits Mon Aug 31 22:14:27 2009 From: Peter Hedlund Date: Mon, 31 Aug 2009 22:14:27 +0000 To: kde-commits Subject: branches/KDE/4.3/kdeedu/kwordquiz/src Message-Id: <1251756867.266944.30805.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125175687427673 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++; }