+ } else if (col == 0 && colinfo.size() > 1 &&
+ is_long_tabular &&
+ p.next_token().cs() == "caption") {
+ // longtable caption support in LyX is a hack:
+ // Captions require a row of their own with
+ // the caption flag set to true, having only
+ // one multicolumn cell. The contents of that
+ // cell must contain exactly one caption inset
+ // and nothing else.
+ // Fortunately, the caption flag is only needed
+ // for tables with more than one column.
+ rowinfo[row].caption = true;
+ for (size_t c = 1; c < cells.size(); ++c) {
+ if (!cells[c].empty()) {
+ cerr << "Moving cell content '"
+ << cells[c]
+ << "' into the caption cell. "
+ "This will probably not work."
+ << endl;
+ cells[0] += cells[c];
+ }
+ }
+ cells.resize(1);
+ cellinfo[row][col].align = colinfo[col].align;
+ cellinfo[row][col].multi = CELL_BEGIN_OF_MULTICOLUMN;
+ ostringstream os;
+ parse_text_in_inset(p, os, FLAG_CELL, false, context);
+ cellinfo[row][col].content += os.str();
+ // add dummy multicolumn cells
+ for (size_t c = 1; c < colinfo.size(); ++c)
+ cellinfo[row][c].multi = CELL_PART_OF_MULTICOLUMN;