OSSP CVS Repository

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

Check-in Number: 3902
Date: 2002-Dec-19 13:53:56 (local)
2002-Dec-19 12:53:56 (UTC)
User:ms
Branch:
Comment: Fixed pasting invalid data bug, and improved getRowdata whitespace format.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/TODO      1.54 -> 1.55     3 inserted, 4 deleted
ossp-pkg/as/as-gui/as_dataop.cpp      1.28 -> 1.29     40 inserted, 25 deleted

ossp-pkg/as/as-gui/TODO 1.54 -> 1.55

--- TODO 2002/12/19 11:24:16     1.54
+++ TODO 2002/12/19 12:53:56     1.55
@@ -34,16 +34,15 @@
 
 Bugs
 ----
-Overidden paintCell() might not work when called asynchronously
-When multiple new rows are added sometimes wrong row shading
+Overidden paintCell() might not work when called asynchronously?
+When multiple new rows are added sometimes wrong row shading?
 Sometimes a click on add or delete toolbar button is ignored?
 Pressing escape on task data cells does not exit edit mode
-Pasting of newly added rows produces mangled results
-Support pasting into as_gui from other app (like vim)
 
 Nice to have
 ------------
 Implement an unlimited and generic undo and redo buffer class
+Support pasting into as_gui from other app (like vim)
 Add optional automatic file personal data file backup
 Make edit control window optional through preferences
 Add customizable column ordering by click and drag


ossp-pkg/as/as-gui/as_dataop.cpp 1.28 -> 1.29

--- as_dataop.cpp        2002/12/18 12:36:16     1.28
+++ as_dataop.cpp        2002/12/19 12:53:56     1.29
@@ -368,34 +368,46 @@
 //
 const QString Titraqform::getRowdata(void) const
 {
-    QString Rowdata;                                        // For output string
+    QString Rowdata, Tempstring;                            // For output string
     QTableSelection Select = m_pMaintable->selection(0);    // Highlighted text
     int nTotal = Select.bottomRow() - Select.topRow() + 1;  // Total row select
 
     // Calculate rows to delete from selection highlight
     for (int nIter = 0; nIter < nTotal; ++nIter) {
         // Build the row data string one field at a time, adding seps inbetween
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXLINE);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXUSER);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXGUID);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXCRC);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXREV);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXDATE);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXSTART);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXFINISH);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXAMOUNT);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXTASK);
-        Rowdata += trUtf8(TITRAQ_SEPARATORTOK);
-        Rowdata += m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXREMARK);
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXLINE);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXUSER);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXGUID);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXCRC);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXREV);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXDATE);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXSTART);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXFINISH);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXAMOUNT);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXTASK);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
+        Tempstring = m_pMaintable->text(Select.topRow() + nIter, TITRAQ_IDXREMARK);
+        if (!Tempstring.isEmpty())
+            Rowdata = Rowdata + trUtf8(TITRAQ_SEPARATORTOK) + Tempstring;
         Rowdata += trUtf8("\n");    // Finish off line
     }
 
@@ -415,9 +427,12 @@
     QTextStream Datastream(&Rowdata, IO_ReadOnly);      // Convert data to stream
 
     for (int nIter = 0; nIter < nRows; ++nIter) {
-        Datastream >> Line >> User >> Guid >> Crc >> Rev;        // Stream data fields
-        Datastream >> Date >> Start >> Finish >> Amount >> Task; // to corresponding vars
-        Remark = Datastream.readLine();                          // Remark is a whole line
+        QString Singlerow = Datastream.readLine();              // For linewise operation
+        QTextStream Rowstream(&Singlerow, IO_ReadOnly);         // Convert row to stream
+
+        Rowstream >> Line >> User >> Guid >> Crc >> Rev;        // Stream data fields
+        Rowstream >> Date >> Start >> Finish >> Amount >> Task; // to corresponding vars
+        Remark = Rowstream.readLine();                          // Remark is a whole line
 
         // Set the table row data one field at a time, skipping seps inbetween
         m_pMaintable->setText(nCurrentrow + nIter, TITRAQ_IDXLINE, Line);

CVSTrac 2.0.1