From 26db00333da75fbbb43d1c31250c9ae482e931a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Tue, 9 Jan 2001 20:17:06 +0000 Subject: [PATCH] support both version 1 and 2 of tabular, some other small changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1309 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 16 + po/POTFILES.in | 28 +- src/Makefile.am | 1 + src/frontends/xforms/FormDocument.C | 2 +- src/tabular-old.C | 231 +++++++++++ src/tabular.C | 572 +++++++++++++++++----------- src/tabular.h | 6 + 7 files changed, 626 insertions(+), 230 deletions(-) create mode 100644 src/tabular-old.C diff --git a/ChangeLog b/ChangeLog index f80e76033a..584bba6fa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2001-01-09 Lars Gullik Bjønnes + + * src/tabular.C (ReadNew): new method + (Read): changed to call ReadNew or ReadOld depending on the + tabular version found. + + * src/tabular-old.C: new file with the support functions and the + ReadOld method. + (ReadOld): new method + + * src/frontends/xforms/FormDocument.C (CheckChoiceClass): make tc + unsigned to remove a signed/usigned warning. + + * src/tabular.C (tostr): new spesializations, replaces type2string + (Write): use the new spesializations + 2001-01-09 Juergen Vigna * src/tabular.C (OldFormatRead): convert the footer/header information diff --git a/po/POTFILES.in b/po/POTFILES.in index 59c622c560..6bbe76c923 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -53,35 +53,35 @@ src/frontends/kde/refdlg.C src/frontends/kde/tocdlg.C src/frontends/kde/urldlg.C src/frontends/xforms/FormBase.h -src/frontends/xforms/FormCitation.C src/frontends/xforms/form_citation.C -src/frontends/xforms/FormCopyright.C +src/frontends/xforms/FormCitation.C src/frontends/xforms/form_copyright.C -src/frontends/xforms/FormDocument.C +src/frontends/xforms/FormCopyright.C src/frontends/xforms/form_document.C -src/frontends/xforms/FormError.C +src/frontends/xforms/FormDocument.C src/frontends/xforms/form_error.C -src/frontends/xforms/FormGraphics.C +src/frontends/xforms/FormError.C src/frontends/xforms/form_graphics.C -src/frontends/xforms/FormIndex.C +src/frontends/xforms/FormGraphics.C src/frontends/xforms/form_index.C +src/frontends/xforms/FormIndex.C src/frontends/xforms/FormInset.h -src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_paragraph.C -src/frontends/xforms/FormPreferences.C +src/frontends/xforms/FormParagraph.C src/frontends/xforms/form_preferences.C -src/frontends/xforms/FormPrint.C +src/frontends/xforms/FormPreferences.C src/frontends/xforms/form_print.C -src/frontends/xforms/FormRef.C +src/frontends/xforms/FormPrint.C src/frontends/xforms/form_ref.C -src/frontends/xforms/FormTabular.C +src/frontends/xforms/FormRef.C src/frontends/xforms/form_tabular.C -src/frontends/xforms/FormTabularCreate.C +src/frontends/xforms/FormTabular.C src/frontends/xforms/form_tabular_create.C -src/frontends/xforms/FormToc.C +src/frontends/xforms/FormTabularCreate.C src/frontends/xforms/form_toc.C -src/frontends/xforms/FormUrl.C +src/frontends/xforms/FormToc.C src/frontends/xforms/form_url.C +src/frontends/xforms/FormUrl.C src/frontends/xforms/input_validators.C src/frontends/xforms/Menubar_pimpl.C src/frontends/xforms/xform_helpers.C diff --git a/src/Makefile.am b/src/Makefile.am index ec959332d2..5c0f9c2714 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -201,6 +201,7 @@ lyx_SOURCES = \ stl_string_fwd.h \ tabular.C \ tabular.h \ + tabular-old.C \ tex-accent.C \ tex-accent.h \ tex-defs.h \ diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 7032d46b10..dfd80357dd 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -1085,7 +1085,7 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) ProhibitInput(lv_->view()); #ifdef USE_CLASS_COMBO - int tc = combo_doc_class->get() - 1; + unsigned int tc = combo_doc_class->get() - 1; string tct = combo_doc_class->getline(); #else int tc = fl_get_choice(ob) - 1; diff --git a/src/tabular-old.C b/src/tabular-old.C new file mode 100644 index 0000000000..ff33d691b9 --- /dev/null +++ b/src/tabular-old.C @@ -0,0 +1,231 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 2000 The LyX Team. + * + * @author: Jürgen Vigna + * + * ====================================================== + */ + +#include + +#include "tabular.h" +#include "debug.h" +#include "support/lstrings.h" + +using std::istream; +using std::getline; +using std::endl; + + +static +bool getTokenValue(string const & str, const char * token, string & ret) +{ + size_t token_length = strlen(token); + string::size_type pos = str.find(token); + + if (pos == string::npos || pos+token_length+1 >= str.length() + || str[pos+token_length] != '=') + return false; + ret.erase(); + pos += token_length + 1; + char 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(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(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(tmp); + return ret; +} + + +static +bool getTokenValue(string const & str, const char * token, bool & flag) +{ + 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++]; + + flag = strToInt(ret); + return true; +} + + +static inline +void l_getline(istream & is, string & str) +{ + getline(is, str); + while(str.empty()) + getline(is, str); +} + + +void LyXTabular::ReadOld(Buffer const * buf, istream & is, + LyXLex & lex, string const & l) +{ + string line(l); + int rows_arg; + int columns_arg; + if (!getTokenValue(line, "rows", rows_arg)) + return; + if (!getTokenValue(line, "columns", columns_arg)) + return; + Init(rows_arg, columns_arg); + l_getline(is, line); + if (!prefixIs(line, " got" << + line << ")" << endl; + return; + } + getTokenValue(line, "islongtable", is_long_tabular); + getTokenValue(line, "endhead", endhead); + getTokenValue(line, "endfirsthead", endfirsthead); + getTokenValue(line, "endfoot", endfoot); + getTokenValue(line, "endlastfoot", endlastfoot); + + for (int i = 0; i < rows_; ++i) { + l_getline(is, line); + if (!prefixIs(line, " got" << + line << ")" << endl; + return; + } + getTokenValue(line, "topline", row_info[i].top_line); + getTokenValue(line, "bottomline", row_info[i].bottom_line); + getTokenValue(line, "newpage", row_info[i].newpage); + for (int j = 0; j < columns_; ++j) { + l_getline(is,line); + if (!prefixIs(line," got" << + line << ")" << endl; + return; + } + if (!i) { + getTokenValue(line, "alignment", column_info[j].alignment); + getTokenValue(line, "valignment", column_info[j].valignment); + getTokenValue(line, "leftline", column_info[j].left_line); + getTokenValue(line, "rightline", column_info[j].right_line); + getTokenValue(line, "width", column_info[j].p_width); + getTokenValue(line, "special", column_info[j].align_special); + } + l_getline(is, line); + if (!prefixIs(line, " got" << + line << ")" << endl; + return; + } + getTokenValue(line, "multicolumn", cell_info[i][j].multicolumn); + getTokenValue(line, "alignment", cell_info[i][j].alignment); + getTokenValue(line, "valignment", cell_info[i][j].valignment); + getTokenValue(line, "topline", cell_info[i][j].top_line); + getTokenValue(line, "bottomline", cell_info[i][j].bottom_line); + getTokenValue(line, "leftline", cell_info[i][j].left_line); + getTokenValue(line, "rightline", cell_info[i][j].right_line); + getTokenValue(line, "rotate", cell_info[i][j].rotate); + getTokenValue(line, "usebox", cell_info[i][j].usebox); + getTokenValue(line, "width", cell_info[i][j].p_width); + getTokenValue(line, "special", cell_info[i][j].align_special); + l_getline(is, line); + if (prefixIs(line, "\\begin_inset")) { + cell_info[i][j].inset.Read(buf, lex); + l_getline(is, line); + } + if (line != "") { + lyxerr << "Wrong tabular format (expected got" << + line << ")" << endl; + return; + } + l_getline(is, line); + if (line != "") { + lyxerr << "Wrong tabular format (expected got" << + line << ")" << endl; + return; + } + } + l_getline(is, line); + if (line != "") { + lyxerr << "Wrong tabular format (expected got" << + line << ")" << endl; + return; + } + } + while (line != "") { + l_getline(is, line); + } + set_row_column_number_info(); +} diff --git a/src/tabular.C b/src/tabular.C index 18b3777bbf..a41f430d30 100644 --- a/src/tabular.C +++ b/src/tabular.C @@ -943,7 +943,68 @@ string const write_attribute(string const & name, bool value) #endif -string const type2string(LyXAlignment num) +// #if 0 +// static inline +// string const type2string(LyXAlignment num) +// { +// switch(num) { +// case LYX_ALIGN_NONE: +// return "none"; +// case LYX_ALIGN_BLOCK: +// return "block"; +// case LYX_ALIGN_LEFT: +// return "left"; +// case LYX_ALIGN_CENTER: +// return "center"; +// case LYX_ALIGN_RIGHT: +// return "right"; +// case LYX_ALIGN_LAYOUT: +// return "layout"; +// case LYX_ALIGN_SPECIAL: +// return "special"; +// } +// return string(); +// } + + +// static inline +// string const type2string(LyXTabular::VAlignment num) +// { +// switch(num) { +// case LyXTabular::LYX_VALIGN_TOP: +// return "top"; +// case LyXTabular::LYX_VALIGN_CENTER: +// return "center"; +// case LyXTabular::LYX_VALIGN_BOTTOM: +// return "bottom"; +// } +// return string(); +// } + + +// static inline +// string const type2string(LyXTabular::BoxType num) +// { +// switch(num) { +// case LyXTabular::BOX_NONE: +// return "none"; +// case LyXTabular::BOX_PARBOX: +// return "parbox"; +// case LyXTabular::BOX_MINIPAGE: +// return "minipage"; +// } +// return string(); +// } + +// static inline +// string const type2string(bool flag) +// { +// return (flag ? "true" : "false"); +// } +// #else +template<> +inline +string const tostr(LyXAlignment const & num) { switch(num) { case LYX_ALIGN_NONE: @@ -965,7 +1026,9 @@ string const type2string(LyXAlignment num) } -string const type2string(LyXTabular::VAlignment num) +template<> +inline +string const tostr(LyXTabular::VAlignment const & num) { switch(num) { case LyXTabular::LYX_VALIGN_TOP: @@ -979,7 +1042,9 @@ string const type2string(LyXTabular::VAlignment num) } -string const type2string(LyXTabular::BoxType num) +template<> +inline +string const tostr(LyXTabular::BoxType const & num) { switch(num) { case LyXTabular::BOX_NONE: @@ -992,25 +1057,35 @@ string const type2string(LyXTabular::BoxType num) return string(); } +// We already have a function like this in lstring.h (Lgb) +//string const type2string(bool flag) +//{ +// return (flag ? "true" : "false"); +//} + + +//#endif + -string const type2string(bool flag) -{ - return (flag ? "true" : "false"); -} void LyXTabular::Write(Buffer const * buf, ostream & os) const { // header line os << "\n"; // global longtable options os << "\n"; for (int j = 0; j < columns_; ++j) { os << "\n"; for (int j = 0; j < columns_; ++j) { #if 0 if (!i) { os << "\n"; @@ -1078,6 +1185,9 @@ void LyXTabular::Write(Buffer const * buf, ostream & os) const } +// I would have liked a fromstr template a lot better. (Lgb) + +static inline bool string2type(string const str, LyXAlignment & num) { if (str == "none") @@ -1096,6 +1206,7 @@ bool string2type(string const str, LyXAlignment & num) } +static inline bool string2type(string const str, LyXTabular::VAlignment & num) { if (str == "top") @@ -1110,6 +1221,7 @@ bool string2type(string const str, LyXTabular::VAlignment & num) } +static inline bool string2type(string const str, LyXTabular::BoxType & num) { if (str == "none") @@ -1124,6 +1236,7 @@ bool string2type(string const str, LyXTabular::BoxType & num) } +static inline bool string2type(string const str, bool & num) { if (str == "true") @@ -1135,6 +1248,7 @@ bool string2type(string const str, bool & num) return true; } + static bool getTokenValue(string const & str, const char * token, string & ret) { @@ -1160,7 +1274,7 @@ bool getTokenValue(string const & str, const char * token, string & ret) //#define USE_OLD_READFORMAT -#ifndef USE_OLD_READFORMAT +//#ifndef USE_OLD_READFORMAT static bool getTokenValue(string const & str, const char * token, int & num) { @@ -1213,90 +1327,90 @@ bool getTokenValue(string const & str, const char * token, bool & flag) return string2type(tmp, flag); } -#else +//#else -static -bool getTokenValue(string const & str, const char * token, int & num) -{ - string::size_type pos = str.find(token); - char ch = str[pos + strlen(token)]; +// 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++]; +// 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; -} +// 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(tmp); - return ret; -} +// static +// bool getTokenValue(string const & str, const char * token, LyXAlignment & num) +// { +// int tmp; +// bool const ret = getTokenValue(str, token, tmp); +// num = static_cast(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(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(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(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(tmp); +// return ret; +// } -static -bool getTokenValue(string const & str, const char * token, bool & flag) -{ - string::size_type pos = str.find(token); - char ch = str[pos + strlen(token)]; +// static +// bool getTokenValue(string const & str, const char * token, bool & flag) +// { +// 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++]; +// 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++]; - flag = strToInt(ret); - return true; -} +// flag = strToInt(ret); +// return true; +// } -#endif +// #endif static inline void l_getline(istream & is, string & str) @@ -1307,26 +1421,54 @@ void l_getline(istream & is, string & str) } -#ifndef USE_OLD_READFORMAT +//#ifndef USE_OLD_READFORMAT void LyXTabular::Read(Buffer const * buf, LyXLex & lex) { - string line; - istream & is = lex.getStream(); + string line; + istream & is = lex.getStream(); - l_getline(is, line); - if (!prefixIs(line, " got" << - line << ")" << endl; - return; - } - getTokenValue(line, "islongtable", is_long_tabular); - getTokenValue(line, "endhead", endhead); - getTokenValue(line, "endfirsthead", endfirsthead); - getTokenValue(line, "endfoot", endfoot); - getTokenValue(line, "endlastfoot", endlastfoot); +// int version; +// int rows_arg; +// int columns_arg; +// if (!getTokenValue(line, "version", version)) +// return; +// if (!getTokenValue(line, "rows", rows_arg)) +// return; +// if (!getTokenValue(line, "columns", columns_arg)) +// return; +// Init(rows_arg, columns_arg); +// l_getline(is, line); +// if (!prefixIs(line, " got" << +// line << ")" << endl; +// return; +// } +// getTokenValue(line, "islongtable", is_long_tabular); +// getTokenValue(line, "endhead", endhead); +// getTokenValue(line, "endfirsthead", endfirsthead); +// getTokenValue(line, "endfoot", endfoot); +// getTokenValue(line, "endlastfoot", endlastfoot); - for (int i = 0; i < rows_; ++i) { - l_getline(is, line); - if (!prefixIs(line, " got" << - line << ")" << endl; - return; - } - getTokenValue(line, "topline", row_info[i].top_line); - getTokenValue(line, "bottomline", row_info[i].bottom_line); - getTokenValue(line, "newpage", row_info[i].newpage); - for (int j = 0; j < columns_; ++j) { - l_getline(is,line); - if (!prefixIs(line," got" << - line << ")" << endl; - return; - } - if (!i) { - getTokenValue(line, "alignment", column_info[j].alignment); - getTokenValue(line, "valignment", column_info[j].valignment); - getTokenValue(line, "leftline", column_info[j].left_line); - getTokenValue(line, "rightline", column_info[j].right_line); - getTokenValue(line, "width", column_info[j].p_width); - getTokenValue(line, "special", column_info[j].align_special); - } - l_getline(is, line); - if (!prefixIs(line, " got" << - line << ")" << endl; - return; - } - getTokenValue(line, "multicolumn", cell_info[i][j].multicolumn); - getTokenValue(line, "alignment", cell_info[i][j].alignment); - getTokenValue(line, "valignment", cell_info[i][j].valignment); - getTokenValue(line, "topline", cell_info[i][j].top_line); - getTokenValue(line, "bottomline", cell_info[i][j].bottom_line); - getTokenValue(line, "leftline", cell_info[i][j].left_line); - getTokenValue(line, "rightline", cell_info[i][j].right_line); - getTokenValue(line, "rotate", cell_info[i][j].rotate); - getTokenValue(line, "usebox", cell_info[i][j].usebox); - getTokenValue(line, "width", cell_info[i][j].p_width); - getTokenValue(line, "special", cell_info[i][j].align_special); - l_getline(is, line); - if (prefixIs(line, "\\begin_inset")) { - cell_info[i][j].inset.Read(buf, lex); - l_getline(is, line); - } - if (line != "") { - lyxerr << "Wrong tabular format (expected got" << - line << ")" << endl; - return; - } - l_getline(is, line); - if (line != "") { - lyxerr << "Wrong tabular format (expected got" << - line << ")" << endl; - return; - } - } - l_getline(is, line); - if (line != "") { - lyxerr << "Wrong tabular format (expected got" << - line << ")" << endl; - return; - } - } - while (line != "") { - l_getline(is, line); - } - set_row_column_number_info(); -} -#endif +// for (int i = 0; i < rows_; ++i) { +// l_getline(is, line); +// if (!prefixIs(line, " got" << +// line << ")" << endl; +// return; +// } +// getTokenValue(line, "topline", row_info[i].top_line); +// getTokenValue(line, "bottomline", row_info[i].bottom_line); +// getTokenValue(line, "newpage", row_info[i].newpage); +// for (int j = 0; j < columns_; ++j) { +// l_getline(is,line); +// if (!prefixIs(line," got" << +// line << ")" << endl; +// return; +// } +// if (!i) { +// getTokenValue(line, "alignment", column_info[j].alignment); +// getTokenValue(line, "valignment", column_info[j].valignment); +// getTokenValue(line, "leftline", column_info[j].left_line); +// getTokenValue(line, "rightline", column_info[j].right_line); +// getTokenValue(line, "width", column_info[j].p_width); +// getTokenValue(line, "special", column_info[j].align_special); +// } +// l_getline(is, line); +// if (!prefixIs(line, " got" << +// line << ")" << endl; +// return; +// } +// getTokenValue(line, "multicolumn", cell_info[i][j].multicolumn); +// getTokenValue(line, "alignment", cell_info[i][j].alignment); +// getTokenValue(line, "valignment", cell_info[i][j].valignment); +// getTokenValue(line, "topline", cell_info[i][j].top_line); +// getTokenValue(line, "bottomline", cell_info[i][j].bottom_line); +// getTokenValue(line, "leftline", cell_info[i][j].left_line); +// getTokenValue(line, "rightline", cell_info[i][j].right_line); +// getTokenValue(line, "rotate", cell_info[i][j].rotate); +// getTokenValue(line, "usebox", cell_info[i][j].usebox); +// getTokenValue(line, "width", cell_info[i][j].p_width); +// getTokenValue(line, "special", cell_info[i][j].align_special); +// l_getline(is, line); +// if (prefixIs(line, "\\begin_inset")) { +// cell_info[i][j].inset.Read(buf, lex); +// l_getline(is, line); +// } +// if (line != "") { +// lyxerr << "Wrong tabular format (expected got" << +// line << ")" << endl; +// return; +// } +// l_getline(is, line); +// if (line != "") { +// lyxerr << "Wrong tabular format (expected got" << +// line << ")" << endl; +// return; +// } +// } +// l_getline(is, line); +// if (line != "") { +// lyxerr << "Wrong tabular format (expected got" << +// line << ")" << endl; +// return; +// } +// } +// while (line != "") { +// l_getline(is, line); +// } +// set_row_column_number_info(); +// } +// #endif void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl) { diff --git a/src/tabular.h b/src/tabular.h index 6b5a9449e5..7b51a08e2a 100644 --- a/src/tabular.h +++ b/src/tabular.h @@ -454,6 +454,12 @@ private: ////////////////////////////////////////////////////////////////// /// typedef std::vector column_vector; + /// + void ReadNew(Buffer const * buf, istream & is, + LyXLex & lex, string const & l); + /// + void ReadOld(Buffer const * buf, istream & is, + LyXLex & lex, string const & l); /// int rows_; ///