]> git.lyx.org Git - lyx.git/blobdiff - src/tabular-old.C
More fixes to the autocollapsing of paragraphs.
[lyx.git] / src / tabular-old.C
index 782d8e71d46fa6488635495ff0bba8bbb55d59eb..9c7c0cac7f80892abe8c4d2c30fdc386140f1bb2 100644 (file)
@@ -41,7 +41,7 @@ bool getTokenValue(string const & str, char const * token, string & ret)
        ret += ch;
        ch = ' ';
     }
-    while((pos < str.length() - 1) && (str[++pos] != ch))
+    while ((pos < str.length() - 1) && (str[++pos] != ch))
        ret += str[pos];
 
     return true;
@@ -64,7 +64,7 @@ bool getTokenValue(string const & str, char const * token, int & num)
        ret += ch;
     }
     ++pos;
-    while((pos < str.length() - 1) && isdigit(str[pos]))
+    while ((pos < str.length() - 1) && isdigit(str[pos]))
        ret += str[pos++];
 
     num = strToInt(ret);
@@ -117,7 +117,7 @@ bool getTokenValue(string const & str, char const * token, bool & flag)
        ret += ch;
     }
     ++pos;
-    while((pos < str.length() - 1) && isdigit(str[pos]))
+    while ((pos < str.length() - 1) && isdigit(str[pos]))
        ret += str[pos++];
 
     flag = strToInt(ret);
@@ -125,6 +125,15 @@ bool getTokenValue(string const & str, char const * token, bool & flag)
 }
 
 
+bool getTokenValue(string const & str, const char * token, LyXLength & len)
+{
+       string tmp;
+       if (!getTokenValue(str, token, tmp))
+               return false;
+       return isValidLength(tmp, &len);
+}    
+
+
 inline
 void l_getline(istream & is, string & str)
 {
@@ -132,7 +141,7 @@ void l_getline(istream & is, string & str)
 //#warning old l_getline
 #endif
     getline(is, str);
-    while(str.empty())
+    while (str.empty())
        getline(is, str);
 }
 
@@ -157,10 +166,10 @@ void LyXTabular::ReadOld(Buffer const * buf, istream & is,
        return;
     }
     getTokenValue(line, "islongtable", is_long_tabular);
-    getTokenValue(line, "endhead", endhead);
-    getTokenValue(line, "endfirsthead", endfirsthead);
-    getTokenValue(line, "endfoot", endfoot);
-    getTokenValue(line, "endlastfoot", endlastfoot);
+    getTokenValue(line, "endhead", endhead.row);
+    getTokenValue(line, "endfirsthead", endfirsthead.row);
+    getTokenValue(line, "endfoot", endfoot.row);
+    getTokenValue(line, "endlastfoot", endlastfoot.row);
 
     for (int i = 0; i < rows_; ++i) {
        l_getline(is, line);