[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.3/kdeedu/kwordquiz/src
From:       Peter Hedlund <peter () peterandlinda ! com>
Date:       2009-08-31 22:14:27
Message-ID: 1251756867.266944.30805.nullmailer () svn ! kde ! org
[Download RAW message or body]

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++;
       }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic