#include "tabular.h"
#include "debug.h"
#include "support/lstrings.h"
+#include "support/textutils.h"
using std::istream;
using std::getline;
ret += ch;
ch = ' ';
}
- while((pos < str.length() - 1) && (str[++pos] != ch))
+ while ((pos < str.length() - 1) && (str[++pos] != ch))
ret += str[pos];
return true;
pos += strlen(token) + 1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
- if (!isdigit(ch))
+ if (!IsDigit(ch))
return false;
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);
pos += strlen(token) + 1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
- if (!isdigit(ch))
+ if (!IsDigit(ch))
return false;
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);
}
+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)
{
//#warning old l_getline
#endif
getline(is, str);
- while(str.empty())
+ while (str.empty())
getline(is, str);
}
return;
}
getTokenValue(line, "islongtable", is_long_tabular);
- getTokenValue(line, "endhead", endhead.row);
- getTokenValue(line, "endfirsthead", endfirsthead.row);
- getTokenValue(line, "endfoot", endfoot.row);
- getTokenValue(line, "endlastfoot", endlastfoot.row);
+ int hrow;
+ int fhrow;
+ int frow;
+ int lfrow;
+
+ getTokenValue(line, "endhead", hrow);
+ getTokenValue(line, "endfirsthead", fhrow);
+ getTokenValue(line, "endfoot", frow);
+ getTokenValue(line, "endlastfoot", lfrow);
+ setHeaderFooterRows(abs(hrow), abs(fhrow), abs(frow), abs(lfrow));
for (int i = 0; i < rows_; ++i) {
l_getline(is, line);