]> git.lyx.org Git - lyx.git/blobdiff - src/support/LSubstring.C
the freespacing patch from Kayvan, draw the math empty delim with onoffdash, asure...
[lyx.git] / src / support / LSubstring.C
index bff2fe8c0cfbd398bd867f3010a157c4ada70553..1369434ab5784225b66b44928442dd99abbade3f 100644 (file)
@@ -3,10 +3,10 @@
  * 
  *           LyX, The Document Processor
  *      
- *         Copyright (C) 1995 Matthias Ettrich
- *          Copyright (C) 1995-1998 The LyX Team.
+ *           Copyright 1995 Matthias Ettrich
+ *           Copyright 1995-1999 The LyX Team.
  *
- *======================================================*/
+ * ====================================================== */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
@@ -21,14 +21,14 @@ LSubstring::LSubstring(string & s, size_type i, size_type l)
 }
 
 
-LSubstring::LSubstring(string & s, string & s2)
+LSubstring::LSubstring(string & s, string const & s2)
        : ps(&s), n(s2.length())
 {
        pos = s.find(s2);
 }
 
 
-LSubstring::LSubstring(string & s, char * p)
+LSubstring::LSubstring(string & s, string::value_type const * p)
        : ps(&s)
 {
        n = strlen(p);
@@ -36,7 +36,7 @@ LSubstring::LSubstring(string & s, char * p)
 }
 
 
-LSubstring::LSubstring(string & s, LRegex & r)
+LSubstring::LSubstring(string & s, LRegex const & r)
        : ps(&s)
 {
        LRegex::MatchPair res = r.first_match(s);
@@ -45,7 +45,7 @@ LSubstring::LSubstring(string & s, LRegex & r)
                pos = res.first;
        } else {
                n = 0;
-               pos = 0;
+               pos = string::npos;
        }
 }
 
@@ -82,13 +82,3 @@ LSubstring::operator string() const
 {
        return string(*ps, pos, n); // copy from *ps
 }
-
-
-#if 0
-LSubstring::operator char const * () const
-{
-       static string tr;
-       tr.assign(*ps, pos, n);
-       return tr.c_str();
-}
-#endif