- istream & is = lex.getStream();
- string s(fl);
- if (s.length() > 8)
- version = atoi(s.c_str() + 8);
- else
- version = 1;
-
- vector<int> cont_row_info;
-
- if (version < 5) {
- lyxerr << "Tabular format < 5 is not supported anymore\n"
- "Get an older version of LyX (< 1.1.x) for conversion!"
- << endl;
- WriteAlert(_("Warning:"),
- _("Tabular format < 5 is not supported anymore\n"),
- _("Get an older version of LyX (< 1.1.x) for conversion!"));
- if (version > 2) {
- is >> rows_arg >> columns_arg >> is_long_tabular_arg
- >> rotate_arg >> a >> b >> c >> d;
- } else
- is >> rows_arg >> columns_arg;
- Init(rows_arg, columns_arg);
- cont_row_info = vector<int>(rows_arg);
- SetLongTabular(is_long_tabular_arg);
- SetRotateTabular(rotate_arg);
- string tmp;
- for (i = 0; i < rows_; ++i) {
- getline(is, tmp);
- cont_row_info[i] = false;
- }
- for (i = 0; i < columns_; ++i) {
- getline(is, tmp);
- }
- for (i = 0; i < rows_; ++i) {
- for (j = 0; j < columns_; ++j) {
- getline(is, tmp);
- }
- }
- } else {
- is >> rows_arg >> columns_arg >> is_long_tabular_arg
- >> rotate_arg >> a >> b >> c >> d;
- Init(rows_arg, columns_arg);
- cont_row_info = vector<int>(rows_arg);
- SetLongTabular(is_long_tabular_arg);
- SetRotateTabular(rotate_arg);
- endhead = a;
- endfirsthead = b;
- endfoot = c;
- endlastfoot = d;
- for (i = 0; i < rows_; ++i) {
- a = b = c = d = e = f = g = h = 0;
- is >> a >> b >> c >> d;
- row_info[i].top_line = a;
- row_info[i].bottom_line = b;
- cont_row_info[i] = c;
- row_info[i].newpage = d;
- }
- for (i = 0; i < columns_; ++i) {
- string s1;
- string s2;
- is >> a >> b >> c;
- char ch; // skip '"'
- is >> ch;
- getline(is, s1, '"');
- is >> ch; // skip '"'
- getline(is, s2, '"');
- column_info[i].alignment = static_cast<char>(a);
- column_info[i].left_line = b;
- column_info[i].right_line = c;
- column_info[i].p_width = s1;
- column_info[i].align_special = s2;
- }
- for (i = 0; i < rows_; ++i) {
- for (j = 0; j < columns_; ++j) {
- string s1;
- string s2;
- is >> a >> b >> c >> d >> e >> f >> g;
- char ch;
- is >> ch; // skip '"'
- getline(is, s1, '"');
- is >> ch; // skip '"'
- getline(is, s2, '"');
- cell_info[i][j].multicolumn = static_cast<char>(a);
- cell_info[i][j].alignment = static_cast<char>(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].rotate = static_cast<bool>(f);
- cell_info[i][j].usebox = static_cast<bool>(g);
- cell_info[i][j].align_special = s1;
- cell_info[i][j].p_width = s2;
- }
- }
- }
- set_row_column_number_info();
-
- LyXParagraph * par = new LyXParagraph;
- LyXParagraph * return_par = 0;
-#ifndef NEW_INSETS
- LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
- LyXParagraph::footnote_kind footnotekind = LyXParagraph::FOOTNOTE;
+ istream & is = lex.getStream();
+ string s(fl);
+ if (s.length() > 8)
+ version = lyx::atoi(s.substr(8, string::npos));
+ else
+ version = 1;
+
+ vector<int> cont_row_info;
+
+ if (version < 5) {
+ lyxerr << "Tabular format < 5 is not supported anymore\n"
+ "Get an older version of LyX (< 1.1.x) for conversion!"
+ << endl;
+ Alert::alert(_("Warning:"),
+ _("Tabular format < 5 is not supported anymore\n"),
+ _("Get an older version of LyX (< 1.1.x) for conversion!"));
+ if (version > 2) {
+ is >> rows_arg >> columns_arg >> is_long_tabular_arg
+ >> rotate_arg >> a >> b >> c >> d;
+ } else
+ is >> rows_arg >> columns_arg;
+ Init(rows_arg, columns_arg);
+ cont_row_info = vector<int>(rows_arg);
+ SetLongTabular(is_long_tabular_arg);
+ SetRotateTabular(rotate_arg);
+ string tmp;
+ for (i = 0; i < rows_; ++i) {
+ getline(is, tmp);
+ cont_row_info[i] = false;
+ }
+ for (i = 0; i < columns_; ++i) {
+ getline(is, tmp);
+ }
+ for (i = 0; i < rows_; ++i) {
+ for (j = 0; j < columns_; ++j) {
+ getline(is, tmp);
+ }
+ }
+ } else {
+ is >> rows_arg >> columns_arg >> is_long_tabular_arg
+ >> rotate_arg >> a >> b >> c >> d;
+ Init(rows_arg, columns_arg);
+ cont_row_info = vector<int>(rows_arg);
+ SetLongTabular(is_long_tabular_arg);
+ SetRotateTabular(rotate_arg);
+ endhead.row = a + 1;
+ endfirsthead.row = b + 1;
+ endfoot.row = c + 1;
+ endlastfoot.row = d + 1;
+ for (i = 0; i < rows_; ++i) {
+ a = b = c = d = e = f = g = 0;
+ is >> a >> b >> c >> d;
+ row_info[i].top_line = a;
+ row_info[i].bottom_line = b;
+ cont_row_info[i] = c;
+ row_info[i].newpage = d;
+ }
+ for (i = 0; i < columns_; ++i) {
+ string s1;
+ string s2;
+ is >> a >> b >> c;
+#if 1
+ char ch; // skip '"'
+ is >> ch;
+#else
+ // ignore is buggy but we will use it later (Lgb)
+ is.ignore(); // skip '"'
+#endif
+ getline(is, s1, '"');
+#if 1
+ is >> ch; // skip '"'
+#else
+ // ignore is buggy but we will use it later (Lgb)
+ is.ignore(); // skip '"'