]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
NPAL16955: syntax storage in a python supervisiongraph. Fix for already sreened singl... T_24092007 T_reliquat_2007
authorjfa <jfa@opencascade.com>
Wed, 19 Sep 2007 09:15:55 +0000 (09:15 +0000)
committerjfa <jfa@opencascade.com>
Wed, 19 Sep 2007 09:15:55 +0000 (09:15 +0000)
src/GraphBase/DataFlowBase_ComputingNode.cxx

index 51b902ff13614e438aaccdf2da1e60d5272b0a89..b97d441b9437bff8fd6d8c003044548b6c4256ac 100644 (file)
@@ -35,11 +35,32 @@ using namespace std;
 static string protectQuotes (const string theText)
 {
   string aRes (theText);
-  for (unsigned int pos = 0; pos < aRes.size(); pos+=2) {
+  unsigned int pos;
+
+  // screen back slash
+  for (pos = 0; pos < aRes.size(); pos++) {
+    pos = aRes.find("\\", pos);
+    if (pos < 0 || pos > aRes.size()) break;
+
+    aRes.insert(pos, "\\");
+    pos++;
+
+    // screen symbol after back slash (except single quote, which will be processed below)
+    if (pos + 1 < aRes.size() && aRes[pos + 1] != '\'') {
+      aRes.insert(pos + 1, "\\");
+      pos++;
+    }
+  }
+
+  // screen single quote
+  for (pos = 0; pos < aRes.size(); pos++) {
     pos = aRes.find("'", pos);
     if (pos < 0 || pos > aRes.size()) break;
-    aRes.replace(pos, 1, "\\\'");
+
+    aRes.insert(pos, "\\");
+    pos++;
   }
+
   return aRes;
 }