]> git.lyx.org Git - lyx.git/blobdiff - src/support/LSubstring.C
small cleanup, doxygen, formatting changes
[lyx.git] / src / support / LSubstring.C
index c253d0e060fa07977848273341653c000d158c7b..21c5d54c67fd1c29a0d406092bae2c8f41a20789 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *      
  *           Copyright 1995 Matthias Ettrich
- *           Copyright 1995-1999 The LyX Team.
+ *           Copyright 1995-2000 The LyX Team.
  *
  * ====================================================== */
 
 #include <config.h>
 #endif
 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
 #include "LSubstring.h"
 
 
@@ -39,13 +43,13 @@ LSubstring::LSubstring(string & s, string::value_type const * p)
 LSubstring::LSubstring(string & s, LRegex const & r)
        : ps(&s)
 {
-       LRegex::MatchPair res = r.first_match(s);
+       LRegex::MatchPair const res = r.first_match(s);
        if (res.first != string::npos) {
                n = res.second;
                pos = res.first;
        } else {
                n = 0;
-               pos = 0;
+               pos = string::npos;
        }
 }
 
@@ -59,7 +63,7 @@ LSubstring & LSubstring::operator=(string const & s)
 
 LSubstring & LSubstring::operator=(LSubstring const & s)
 {
-       ps->replace(pos, n, string(s, 0, string::npos));
+       ps->replace(pos, n, s);
        return *this;
 }