- // ignore is buggy but we will use it later (Lgb)
- is.ignore(); // skip '"'
-#endif
- getline(is, s2, '"');
- cell_info[i][j].multicolumn = static_cast<char>(a);
- cell_info[i][j].alignment = static_cast<LyXAlignment>(b);
- cell_info[i][j].top_line = static_cast<char>(c);
- cell_info[i][j].bottom_line = static_cast<char>(d);
- cell_info[i][j].left_line = column_info[j].left_line;
- cell_info[i][j].right_line = column_info[j].right_line;
- cell_info[i][j].rotate = static_cast<bool>(f);
- cell_info[i][j].usebox = static_cast<BoxType>(g);
- cell_info[i][j].align_special = s1;
- cell_info[i][j].p_width = s2;
- }
- }
- }
- set_row_column_number_info(true);
-
- LyXParagraph * par = new LyXParagraph;
- LyXParagraph * return_par = 0;
-#ifndef NEW_INSETS
- LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
- LyXParagraph::footnote_kind footnotekind = LyXParagraph::FOOTNOTE;
-#endif
- string tmptok;
- int pos = 0;
- char depth = 0;
- LyXFont font(LyXFont::ALL_SANE);
- font.setLanguage(owner_->BufferOwner()->GetLanguage());
-
- while (lex.IsOK()) {
- lex.nextToken();
- string const token = lex.GetString();
- if (token.empty())
- continue;
- if (token == "\\layout"
- || token == "\\end_float"
- || token == "\\end_deeper") {
- lex.pushToken(token);
- break;
- }
- if (owner_->BufferOwner()->parseSingleLyXformat2Token(lex, par,
- return_par,
- token, pos,
- depth, font
-#ifndef NEW_INSETS
- ,
- footnoteflag,
- footnotekind
-#endif
- ))
- {
- // the_end read
- lex.pushToken(token);
- break;
- }
- if (return_par) {
- lex.printError("New Paragraph allocated! This should not happen!");
- lex.pushToken(token);
- delete par;
- par = return_par;
- break;
- }
- }
- // now we have the par we should fill the insets with this!
- int cell = 0;
- InsetText * inset = GetCellInset(cell);
- int row;
-
- for (int i = 0; i < par->Last(); ++i) {
- if (par->IsNewline(i)) {
- ++cell;
- if (cell > GetNumberOfCells()) {
- lyxerr << "Some error in reading old table format occured!" <<
- endl << "Terminating when reading cell[" << cell << "]!" <<
- endl;
- delete par;
- return;
- }
- row = row_of_cell(cell);
- if (cont_row_info[row]) {
- DeleteRow(row);
- cont_row_info.erase(cont_row_info.begin() + row); //&cont_row_info[row]);
- while(!IsFirstCellInRow(--cell));
- } else {
- inset = GetCellInset(cell);
- continue;
- }
- inset = GetCellInset(cell);
- row = row_of_cell(cell);
- if (!cell_info[row_of_cell(cell)][column_of_cell(cell)].usebox)
- {
- // insert a space instead
- par->Erase(i);
- par->InsertChar(i, ' ');
- }
- }
- par->CopyIntoMinibuffer(*owner_->BufferOwner(), i);
- inset->par->InsertFromMinibuffer(inset->par->Last());
- }
- delete par;
- Reinit();
-}
-
-
-string const LyXTabular::GetDocBookAlign(int cell, bool isColumn) const
-{
- int const i = isColumn ? cell : column_of_cell(cell);
-
- if (!isColumn && IsMultiColumn(cell)) {
- if (!cellinfo_of_cell(cell)->align_special.empty()) {
- return cellinfo_of_cell(cell)->align_special;
- } else {
- switch (GetAlignment(cell)) {
- case LYX_ALIGN_LEFT:
- return "left";
- case LYX_ALIGN_RIGHT:
- return "right";
- default:
- return "center";
- }
- }
- } else {
- if (!column_info[i].align_special.empty()) {
- return column_info[i].align_special;
- }
-#ifdef IGNORE_THIS_FOR_NOW
- else if (!column_info[i].p_width.empty()) {
- file += "p{";
- file += column_info[i].p_width;
- file += '}';
- }