]> git.lyx.org Git - lyx.git/blobdiff - src/tabular-old.C
Fix crash when running lyx -dbg insets -e ...
[lyx.git] / src / tabular-old.C
index ff33d691b943ad832352354f88c49b31409b518a..ec9c0fe9bc2495f9b8d457097ed45efbec610500 100644 (file)
@@ -3,7 +3,7 @@
  * 
  *           LyX, The Document Processor
  *      
- *           Copyright 2000 The LyX Team.
+ *           Copyright 2000-2001 The LyX Team.
  *
  *           @author: Jürgen Vigna
  *
@@ -20,15 +20,19 @@ using std::istream;
 using std::getline;
 using std::endl;
 
+#ifndef CXX_GLOBAL_CSTD
+using std::strlen;
+#endif
+
+namespace {
 
-static
 bool getTokenValue(string const & str, const char * token, string & ret)
 {
     size_t token_length = strlen(token);
     string::size_type pos = str.find(token);
 
-    if (pos == string::npos || pos+token_length+1 >= str.length()
-       || str[pos+token_length] != '=')
+    if (pos == string::npos || pos + token_length + 1 >= str.length()
+       || str[pos + token_length] != '=')
        return false;
     ret.erase();
     pos += token_length + 1;
@@ -44,7 +48,6 @@ bool getTokenValue(string const & str, const char * token, string & ret)
 }
 
 
-static
 bool getTokenValue(string const & str, const char * token, int & num)
 {
     string::size_type pos = str.find(token);
@@ -69,7 +72,6 @@ bool getTokenValue(string const & str, const char * token, int & num)
 }
 
 
-static
 bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
 {
     int tmp;
@@ -79,7 +81,6 @@ bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
 }
 
 
-static
 bool getTokenValue(string const & str, const char * token,
                   LyXTabular::VAlignment & num)
 {
@@ -90,7 +91,6 @@ bool getTokenValue(string const & str, const char * token,
 }
 
 
-static
 bool getTokenValue(string const & str, const char * token,
                   LyXTabular::BoxType & num)
 {
@@ -101,7 +101,6 @@ bool getTokenValue(string const & str, const char * token,
 }
 
 
-static
 bool getTokenValue(string const & str, const char * token, bool & flag)
 {
     string::size_type pos = str.find(token);
@@ -126,14 +125,19 @@ bool getTokenValue(string const & str, const char * token, bool & flag)
 }
 
 
-static inline
+inline
 void l_getline(istream & is, string & str)
 {
+#ifdef WITH_WARNINGS
+#warning old l_getline
+#endif
     getline(is, str);
     while(str.empty())
        getline(is, str);
 }
 
+} // namespace anon
+
 
 void LyXTabular::ReadOld(Buffer const * buf, istream & is,
                         LyXLex & lex, string const & l)
@@ -202,7 +206,7 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
            getTokenValue(line, "special", cell_info[i][j].align_special);
            l_getline(is, line);
            if (prefixIs(line, "\\begin_inset")) {
-               cell_info[i][j].inset.Read(buf, lex);
+               cell_info[i][j].inset.read(buf, lex);
                l_getline(is, line);
            }
            if (line != "</Cell>") {