From 30964c75af4dc4f2f3fea27e43404c0dd8388a80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Sun, 27 Jul 2003 21:39:54 +0000 Subject: [PATCH] Add \end_layout, increment file format. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7397 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/ChangeLog | 4 ++++ development/FORMAT | 6 ++++++ src/ChangeLog | 6 ++++++ src/buffer.C | 2 +- src/paragraph.C | 2 ++ src/paragraph_funcs.C | 19 +++++++++++-------- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/development/ChangeLog b/development/ChangeLog index 7d6d924703..2041f3c7c7 100644 --- a/development/ChangeLog +++ b/development/ChangeLog @@ -1,3 +1,7 @@ +2003-07-28 José Matos + + * FORMAT: document 225 + 2003-02-10 Angus Leeming * FORMAT: document 224. diff --git a/development/FORMAT b/development/FORMAT index 231d373d15..a0503ed9ae 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,12 @@ LyX file-format changes ----------------------- +2003-07-28 José Matos + + Format bumped to 225 + + * All layouts finish now with \end_layout + 2003-06-04 Angus Leeming Format bumped to 224 diff --git a/src/ChangeLog b/src/ChangeLog index 8d0062cf9c..627a04a059 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-07-28 José Matos + + * buffer.C: increment file format. + * paragraph_funcs (readParagraph, readParToken): + * paragraph.C (readParagraph): add \end_layout. + 2003-07-27 Angus Leeming * Makefile.am: remove special casing for configure-time setting of diff --git a/src/buffer.C b/src/buffer.C index b7afa7c11a..4c9c7c1bd0 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -115,7 +115,7 @@ extern BufferList bufferlist; namespace { -const int LYX_FORMAT = 224; +const int LYX_FORMAT = 225; bool openFileWrite(ofstream & ofs, string const & fname) { diff --git a/src/paragraph.C b/src/paragraph.C index daeec8dd78..2c4019f15d 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -240,6 +240,8 @@ void Paragraph::write(Buffer const * buf, ostream & os, } Changes::lyxMarkChange(os, column, curtime, running_change, Change(Change::UNCHANGED)); + + os << "\n\\end_layout\n"; } diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 283445048b..3448b7ced0 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -826,13 +826,12 @@ int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & tok 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") { lyxerr << "Solitary \\end_inset in line " << lex.getLineNo() << "\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") { InsetOld * inset = readInset(lex, buf); par.insertInset(par.size(), inset, font, change); @@ -982,16 +981,20 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex) if (token.empty()) continue; + if (token == "\\end_layout") { + //Ok, paragraph finished + break; + } + lyxerr[Debug::PARSER] << "Handling paragraph token: `" << 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" || token == "\\end_inset" || token == "\\begin_deeper" || token == "\\end_deeper") { lex.pushToken(token); + lyxerr << "Paragraph ended in line " + << lex.getLineNo() << "\n" + << "Missing \\end_layout.\n"; break; } } -- 2.39.2