]> git.lyx.org Git - lyx.git/commitdiff
Add \end_layout, increment file format.
authorJosé Matox <jamatos@lyx.org>
Sun, 27 Jul 2003 21:39:54 +0000 (21:39 +0000)
committerJosé Matox <jamatos@lyx.org>
Sun, 27 Jul 2003 21:39:54 +0000 (21:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7397 a592a061-630c-0410-9148-cb99ea01b6c8

development/ChangeLog
development/FORMAT
src/ChangeLog
src/buffer.C
src/paragraph.C
src/paragraph_funcs.C

index 7d6d9247034406ee278eaba98b4614b3c9846a36..2041f3c7c747380e36b973b637d34e74c80169b8 100644 (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>
 
        * FORMAT: document 224.
index 231d373d15c720f93d48bc03cab45380938e1f14..a0503ed9aec53cf1d6745795d2647804d1c1211c 100644 (file)
@@ -1,6 +1,12 @@
 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>
 
        Format bumped to 224
index 8d0062cf9c9bd3a4d279a9702c099b58b52c8c51..627a04a059b46921de1e77bf95649fc52f5102ed 100644 (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>
 
        * Makefile.am: remove special casing for configure-time setting of
index b7afa7c11a69504c38f2178cd4b89e22159cfea6..4c9c7c1bd082c0493d0492c161c2b1456065104f 100644 (file)
@@ -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)
 {
index daeec8dd78ba8e850d40c06b5973d6db4d9d3db0..2c4019f15d7c69746e2dd4ab493e38d649e70098 100644 (file)
@@ -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";
 }
 
 
index 283445048b5c4abe9b7acbb11cd30671a1ecf033..3448b7ced019fdd47766f33c344ffa05d93724fb 100644 (file)
@@ -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;
                }
        }