Increase the file format, now every \\begin_deeper has a corresponding \\end_deeper.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19461 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
José Matox 2007-08-12 14:56:49 +00:00
parent 31d782b820
commit f130c13c7b
5 changed files with 41 additions and 3 deletions

View File

@ -1,6 +1,18 @@
LyX file-format changes
-----------------------
2007-08-12 José Matos
* format incremented to 278: Close begin_deeper with a
corresponding end_deeper (the only case where it matters is
at the end of the body).
2007-08-12 José Matos
* format incremented to 277: lyx is able to create invalid
table where a multicolumn does not have a first cell
(required by the table file format)
2007-07-20 Dov Feldstern <dov@lyx.org>
* format *not* incremented; fixed format 249 conversion, so that it now

View File

@ -78,7 +78,7 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)),
("1_3", [221], generate_minor_versions("1.3" , 7)),
("1_4", range(222,246), generate_minor_versions("1.4" , 5)),
("1_5", range(246,277), generate_minor_versions("1.5" , 1)),
("1_6", range(277,278), generate_minor_versions("1.6" , 0))]
("1_6", range(277,279), generate_minor_versions("1.6" , 0))]
def formats_list():

View File

@ -22,7 +22,7 @@ import re
import unicodedata
import sys, os
from parser_tools import find_token, find_end_of
from parser_tools import find_token, find_end_of, find_tokens
####################################################################
# Private helper functions
@ -67,6 +67,26 @@ def fix_wrong_tables(document):
i = j + 1
def close_begin_deeper(document):
i = 0
depth = 0
while True:
i = find_tokens(document.body, ["\\begin_deeper", "\\end_deeper"], i)
if i == -1:
break
if document.body[i][:13] == "\\begin_deeper":
depth += 1
else:
depth -= 1
i += 1
document.body[-2:-2] = ['\\end_deeper' for i in range(depth)]
##
# Conversion hub
#
@ -74,10 +94,12 @@ def fix_wrong_tables(document):
supported_versions = ["1.6.0","1.6"]
convert = [
[277, [fix_wrong_tables]],
[278, [close_begin_deeper]],
]
revert = [
[276, []],
[277, []],
]

View File

@ -136,7 +136,7 @@ namespace fs = boost::filesystem;
namespace {
int const LYX_FORMAT = 277;
int const LYX_FORMAT = 278;
} // namespace anon

View File

@ -1628,6 +1628,10 @@ void Text::write(Buffer const & buf, std::ostream & os) const
depth_type dth = 0;
for (; pit != end; ++pit)
pit->write(buf, os, buf.params(), dth);
// Close begin_deeper
for(; dth > 0; --dth)
os << "\n\\end_deeper";
}