OSSP CVS Repository

ossp - Check-in [3987]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3987
Date: 2003-Feb-03 12:04:23 (local)
2003-Feb-03 11:04:23 (UTC)
User:ms
Branch:
Comment: Deny pasting of empty data and adding of zero rows. The add entry operation is intended for this and already available.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_slot.cpp      1.104 -> 1.105     6 inserted, 5 deleted

ossp-pkg/as/as-gui/as_slot.cpp 1.104 -> 1.105

--- as_slot.cpp  2003/02/03 10:57:57     1.104
+++ as_slot.cpp  2003/02/03 11:04:23     1.105
@@ -97,11 +97,12 @@
     QString Selection;          // Will receive the clipboard text
     QClipboard *pClip = NULL;   // Will reference the global clipboard
 
-    pClip = QApplication::clipboard();                    // Prime the clips
-    if (Selection = pClip->text(QClipboard::Clipboard)) { // Windows and Unix
-        nRows = Selection.contains(QChar('\n'));    // How many rows
-        this->addEntry(nRows);                      // Reuse slot
-        setRowdata(Selection);                      // Use accessor
+    pClip = QApplication::clipboard();                  // Prime the clips
+    Selection = pClip->text(QClipboard::Clipboard);     // Windows and Unix
+    nRows = Selection.contains(QChar('\n'));            // How many rows
+    if (Selection != NULL && nRows > 0) { // Ignore empty clipboards
+        this->addEntry(nRows);                          // Reuse slot
+        setRowdata(Selection);                          // Use accessor
 
         // Update line numbers for this new row and all subsequent rows
         for (int nIter = m_pMaintable->currentRow(); nIter < m_pMaintable->numRows(); nIter++)

CVSTrac 2.0.1