OSSP CVS Repository

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

Check-in Number: 4013
Date: 2003-Feb-06 16:27:39 (local)
2003-Feb-06 15:27:39 (UTC)
User:ms
Branch:
Comment: Implemented embedding of escape characters into event data file.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/ChangeLog      1.33 -> 1.34     2 inserted, 0 deleted
ossp-pkg/as/as-gui/as_dataop.cpp      1.44 -> 1.45     7 inserted, 5 deleted

ossp-pkg/as/as-gui/ChangeLog 1.33 -> 1.34

--- ChangeLog    2003/02/06 14:10:33     1.33
+++ ChangeLog    2003/02/06 15:27:39     1.34
@@ -1,5 +1,7 @@
 Geschichte des OSSP titraq in Vorwaerts Cronordnung
 
+030206 Implemented embedding of escape characters into event data file
+
 030205 Add logic to save empty remark fields with surrounding double quotes
        CORBA client transmission improvements, including multiple entry allowance
 


ossp-pkg/as/as-gui/as_dataop.cpp 1.44 -> 1.45

--- as_dataop.cpp        2003/02/06 14:10:33     1.44
+++ as_dataop.cpp        2003/02/06 15:27:39     1.45
@@ -270,10 +270,10 @@
         Asline.skipWhiteSpace();    // Remove whitespaces
         Remark = Asline.read();     // Copy the remark field
 
-        QRegExp Quoted("\"(.*)[^\\]\"");            // Get rid of
-        Quoted.search(Remark);                      // surrounding double
-        Remark = Quoted.cap(Quoted.numCaptures());  // quotes, and
-        Remark.replace("\\(.)", "\1");              // escape backslashes
+        QRegExp Quoted("\"(.*[^\\\\])\"");                  // Get rid of
+        Quoted.search(Remark);                              // surrounding double
+        Remark = Quoted.cap(Quoted.numCaptures());          // quotes, and
+        Remark.replace(QRegExp("\\\\(.)"), QString("\\1")); // escape backslashes
 
         if (!Remark.isEmpty())
             m_pMaintable->setText(nIter, TITRAQ_IDXREMARK, Remark);
@@ -422,7 +422,9 @@
         if (Tempfield != NULL) {
             Strsearch = QRegExp::escape(Tempfield);                 // Incoming string escaped
             Stripper.search(Strsearch);
-            Tempfield.truncate(Stripper.pos());
+            Tempfield.truncate(Stripper.pos());                     // Cut off whitespace
+            Tempfield.replace(QChar('\\'), QString("\\\\"));        // Escape back slashes
+            Tempfield.replace(QChar('\"'), QString("\\\""));        // Escape double quotes
             Tstream << Tempfield;                                   // Save remark field text
         }
         Tstream << trUtf8("\"");                                    // Save ending double quote

CVSTrac 2.0.1