merge the two parts of Tabular::read()

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7166 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-06-12 14:29:45 +00:00
parent 9fc4051e89
commit 6097aeb408
2 changed files with 17 additions and 26 deletions

View File

@ -1083,25 +1083,6 @@ void LyXTabular::write(Buffer const * buf, ostream & os) const
} }
void LyXTabular::read(Buffer const * buf, LyXLex & lex)
{
string line;
istream & is = lex.getStream();
l_getline(is, line);
if (!prefixIs(line, "<lyxtabular ")
&& !prefixIs(line, "<LyXTabular ")) {
lyx::Assert(false);
return;
}
int version;
if (!getTokenValue(line, "version", version))
return;
lyx::Assert(version >= 2);
read(buf, is, lex, line, version);
}
void LyXTabular::setHeaderFooterRows(int hr, int fhr, int fr, int lfr) void LyXTabular::setHeaderFooterRows(int hr, int fhr, int fr, int lfr)
{ {
// set header info // set header info
@ -1179,10 +1160,24 @@ void LyXTabular::setHeaderFooterRows(int hr, int fhr, int fr, int lfr)
} }
} }
void LyXTabular::read(Buffer const * buf, istream & is,
LyXLex & lex, string const & l, int const version) void LyXTabular::read(Buffer const * buf, LyXLex & lex)
{ {
string line(l); string line;
istream & is = lex.getStream();
l_getline(is, line);
if (!prefixIs(line, "<lyxtabular ")
&& !prefixIs(line, "<LyXTabular ")) {
lyx::Assert(false);
return;
}
int version;
if (!getTokenValue(line, "version", version))
return;
lyx::Assert(version >= 2);
int rows_arg; int rows_arg;
if (!getTokenValue(line, "rows", rows_arg)) if (!getTokenValue(line, "rows", rows_arg))
return; return;

View File

@ -478,10 +478,6 @@ private:
/// ///
typedef std::vector<columnstruct> column_vector; typedef std::vector<columnstruct> column_vector;
///
void read(Buffer const * buf, std::istream & is,
LyXLex & lex, string const & l, int const version);
///
/// ///
int rows_; int rows_;
/// ///