- } else {
- os << "<Column>\n";
- }
- os << "<Cell"
- << write_attribute("multicolumn", cell_info[i][j].multicolumn)
- << write_attribute("alignment", cell_info[i][j].alignment)
- << write_attribute("valignment", cell_info[i][j].valignment)
- << write_attribute("topline", cell_info[i][j].top_line)
- << write_attribute("bottomline", cell_info[i][j].bottom_line)
- << write_attribute("leftline", cell_info[i][j].left_line)
- << write_attribute("rightline", cell_info[i][j].right_line)
- << write_attribute("rotate", cell_info[i][j].rotate)
- << write_attribute("usebox", cell_info[i][j].usebox)
- << write_attribute("width", cell_info[i][j].p_width)
- << write_attribute("special", cell_info[i][j].align_special)
- << ">\n";
- os << "\\begin_inset ";
- cell_info[i][j].inset.Write(buf, os);
- os << "\n\\end_inset \n"
- << "</Cell>\n"
- << "</Column>\n";
- }
- os << "</Row>\n";
- }
- os << "</LyXTabular>\n";
-}
-
-
-static
-bool getTokenValue(string const & str, const char * token, string & ret)
-{
- string::size_type pos = str.find(token);
- char ch = str[pos + strlen(token)];
-
- if ((pos == string::npos) || (ch != '='))
- return false;
- ret.erase();
- pos += strlen(token) + 1;
- ch = str[pos];
- if ((ch != '"') && (ch != '\'')) { // only read till next space
- ret += ch;
- ch = ' ';
- }
- while((pos < str.length() - 1) && (str[++pos] != ch))
- ret += str[pos];
-
- return true;
-}
-
-
-static
-bool getTokenValue(string const & str, const char * token, int & num)
-{
- string::size_type pos = str.find(token);
- char ch = str[pos + strlen(token)];
-
- if ((pos == string::npos) || (ch != '='))
- return false;
- string ret;
- pos += strlen(token) + 1;
- ch = str[pos];
- if ((ch != '"') && (ch != '\'')) { // only read till next space
- if (!isdigit(ch))
- return false;
- ret += ch;
- }
- ++pos;
- while((pos < str.length() - 1) && isdigit(str[pos]))
- ret += str[pos++];
-
- num = strToInt(ret);
- return true;
-}
-
-
-static
-bool getTokenValue(string const & str, const char * token, LyXAlignment & num)
-{
- int tmp;
- bool const ret = getTokenValue(str, token, tmp);
- num = static_cast<LyXAlignment>(tmp);
- return ret;
-}
-
-
-static
-bool getTokenValue(string const & str, const char * token,
- LyXTabular::VAlignment & num)
-{
- int tmp;
- bool const ret = getTokenValue(str, token, tmp);
- num = static_cast<LyXTabular::VAlignment>(tmp);
- return ret;
-}
-
-
-static
-bool getTokenValue(string const & str, const char * token,
- LyXTabular::BoxType & num)
-{
- int tmp;
- bool ret = getTokenValue(str, token, tmp);
- num = static_cast<LyXTabular::BoxType>(tmp);
- return ret;
+ }
+ for (int i = 0; i < rows_; ++i) {
+ os << "<row"
+ << write_attribute("topline", row_info[i].top_line)
+ << write_attribute("bottomline", row_info[i].bottom_line)
+ << write_attribute("endhead", row_info[i].endhead)
+ << write_attribute("endfirsthead", row_info[i].endfirsthead)
+ << write_attribute("endfoot", row_info[i].endfoot)
+ << write_attribute("endlastfoot", row_info[i].endlastfoot)
+ << write_attribute("newpage", row_info[i].newpage)
+ << ">\n";
+ for (int j = 0; j < columns_; ++j) {
+ os << "<cell"
+ << write_attribute("multicolumn", cell_info[i][j].multicolumn)
+ << write_attribute("alignment", cell_info[i][j].alignment)
+ << write_attribute("valignment", cell_info[i][j].valignment)
+ << write_attribute("topline", cell_info[i][j].top_line)
+ << write_attribute("bottomline", cell_info[i][j].bottom_line)
+ << write_attribute("leftline", cell_info[i][j].left_line)
+ << write_attribute("rightline", cell_info[i][j].right_line)
+ << write_attribute("rotate", cell_info[i][j].rotate)
+ << write_attribute("usebox", cell_info[i][j].usebox)
+ << write_attribute("width", cell_info[i][j].p_width)
+ << write_attribute("special", cell_info[i][j].align_special)
+ << ">\n";
+ os << "\\begin_inset ";
+ cell_info[i][j].inset.write(buf, os);
+ os << "\n\\end_inset \n"
+ << "</cell>\n";
+ }
+ os << "</row>\n";
+ }
+ os << "</lyxtabular>\n";