Add \end_layout, increment file format.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7397 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2003-07-27 21:39:54 +00:00
parent eee532a581
commit 30964c75af
6 changed files with 30 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2003-07-28 José Matos <jamatos@fep.up.pt>
* FORMAT: document 225
2003-02-10 Angus Leeming <leeming@lyx.org> 2003-02-10 Angus Leeming <leeming@lyx.org>
* FORMAT: document 224. * FORMAT: document 224.

View File

@ -1,6 +1,12 @@
LyX file-format changes LyX file-format changes
----------------------- -----------------------
2003-07-28 José Matos <jamatos@fep.up.pt>
Format bumped to 225
* All layouts finish now with \end_layout
2003-06-04 Angus Leeming <leeming@lyx.org> 2003-06-04 Angus Leeming <leeming@lyx.org>
Format bumped to 224 Format bumped to 224

View File

@ -1,3 +1,9 @@
2003-07-28 José Matos <jamatos@fep.up.pt>
* buffer.C: increment file format.
* paragraph_funcs (readParagraph, readParToken):
* paragraph.C (readParagraph): add \end_layout.
2003-07-27 Angus Leeming <leeming@lyx.org> 2003-07-27 Angus Leeming <leeming@lyx.org>
* Makefile.am: remove special casing for configure-time setting of * Makefile.am: remove special casing for configure-time setting of

View File

@ -115,7 +115,7 @@ extern BufferList bufferlist;
namespace { namespace {
const int LYX_FORMAT = 224; const int LYX_FORMAT = 225;
bool openFileWrite(ofstream & ofs, string const & fname) bool openFileWrite(ofstream & ofs, string const & fname)
{ {

View File

@ -240,6 +240,8 @@ void Paragraph::write(Buffer const * buf, ostream & os,
} }
Changes::lyxMarkChange(os, column, curtime, Changes::lyxMarkChange(os, column, curtime,
running_change, Change(Change::UNCHANGED)); running_change, Change(Change::UNCHANGED));
os << "\n\\end_layout\n";
} }

View File

@ -826,13 +826,12 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok
par.params().read(lex); par.params().read(lex);
} else if (token == "\\end_layout") {
lyxerr << "Solitary \\end_layout in line " << lex.getLineNo() << "\n"
<< "Missing \\layout?.\n";
} else if (token == "\\end_inset") { } else if (token == "\\end_inset") {
lyxerr << "Solitary \\end_inset in line " << lex.getLineNo() << "\n" lyxerr << "Solitary \\end_inset in line " << lex.getLineNo() << "\n"
<< "Missing \\begin_inset?.\n"; << "Missing \\begin_inset?.\n";
// Simply ignore this. The insets do not have
// to read this.
// But insets should read it, it is a part of
// the inset isn't it? Lgb.
} else if (token == "\\begin_inset") { } else if (token == "\\begin_inset") {
InsetOld * inset = readInset(lex, buf); InsetOld * inset = readInset(lex, buf);
par.insertInset(par.size(), inset, font, change); par.insertInset(par.size(), inset, font, change);
@ -982,16 +981,20 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex)
if (token.empty()) if (token.empty())
continue; continue;
if (token == "\\end_layout") {
//Ok, paragraph finished
break;
}
lyxerr[Debug::PARSER] << "Handling paragraph token: `" lyxerr[Debug::PARSER] << "Handling paragraph token: `"
<< token << '\'' << endl; << token << '\'' << endl;
// reached the next paragraph. FIXME: really we should
// change the file format to indicate the end of a par
// clearly, but for now, this hack will do
if (token == "\\layout" || token == "\\the_end" if (token == "\\layout" || token == "\\the_end"
|| token == "\\end_inset" || token == "\\begin_deeper" || token == "\\end_inset" || token == "\\begin_deeper"
|| token == "\\end_deeper") { || token == "\\end_deeper") {
lex.pushToken(token); lex.pushToken(token);
lyxerr << "Paragraph ended in line "
<< lex.getLineNo() << "\n"
<< "Missing \\end_layout.\n";
break; break;
} }
} }