eda/NoCaseAccent SQLFunction & TableEditor: Fixed searching for strings containing...
authorJerome St-Louis <jerome@ecere.com>
Sun, 29 Jul 2012 01:48:16 +0000 (21:48 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 29 Jul 2012 01:48:16 +0000 (21:48 -0400)
eda/libeda/src/gui/TableEditor.ec

index e3c1f6c..d0bc743 100644 (file)
@@ -73,7 +73,7 @@ public char * ConvertToASCII(char * string, char * newString, int * len, bool lo
       for(c = 0; (unich = UTF8GetChar(string + c, &nb)); c += nb)
       {
          char ch = ToASCII(unich);
-         if(ch < 128 && ch > 32) //(ch == '-' || isalpha(ch) || ch == ','))
+         if(ch < 128)
             newString[d++] = lowerCase ? (char)tolower(ch) : (char)ch;
       }
       newString[d] = 0;
@@ -970,6 +970,21 @@ private:
                                  }
                                  else
                                     ln = CopyString(searchCI.array);
+                                 if(ln)
+                                 {
+                                    TrimLSpaces(ln, ln);
+                                    TrimRSpaces(ln, ln);
+                                 }
+                                 if(fn)
+                                 {
+                                    TrimLSpaces(fn, fn);
+                                    TrimRSpaces(fn, fn);
+                                 }
+                                 if(mn)
+                                 {
+                                    TrimLSpaces(mn, mn);
+                                    TrimRSpaces(mn, mn);
+                                 }
 
                                  /* We could simply do this if we had access to PersonName: (don't forget the delete pn; below)
                                  PersonName pn;