From 25bf63f1a189c4e0cb9f85ca77af9ee9fa6049f1 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 1 Jul 2004 14:40:59 +0000 Subject: [PATCH] update file format to reflect the paperpackage bugfix git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8829 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/ChangeLog | 4 ++++ development/FORMAT | 10 ++++++++++ lib/lyx2lyx/ChangeLog | 7 +++++++ lib/lyx2lyx/lyx_1_4.py | 33 +++++++++++++++++++++++++++++++++ lib/lyx2lyx/parser_tools.py | 4 ++-- src/ChangeLog | 4 ++++ src/buffer.C | 2 +- 7 files changed, 61 insertions(+), 3 deletions(-) diff --git a/development/ChangeLog b/development/ChangeLog index 656a716481..c8161237ed 100644 --- a/development/ChangeLog +++ b/development/ChangeLog @@ -1,3 +1,7 @@ +2004-07-01 Georg Baum + + * FORMAT: document change to format 235. + 2004-05-12 Angus Leeming * FORMAT: document change to format 234. diff --git a/development/FORMAT b/development/FORMAT index 42505511fb..d0b716e72b 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,16 @@ LyX file-format changes ----------------------- +2004-07-01 Georg Baum + + * format incremented to 235. + * \paperpackage had an off-by-one error. Translation table: + + 234: a4 a4wide widemarginsa4 + 235: none a4 a4wide widemarginsa4 + + The "widemarginsa4" setting of 235 has no equivalent in 234. + 2004-05-12 Angus Leeming * format incremented to 234. diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index ff7217b405..cd313dd09d 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,10 @@ +2004-07-01 Georg Baum + + * lyx_1_4.py (convert_paperpackage): new, convert paperpackage setting + * lyx_1_4.py (revert_paperpackage): new, revert paperpackage setting + * lyx_1_4.py (revert, convert): handle format 235 + * parser_tools.py: up the format to 235. + 2004-05-12 Angus Leeming * lyx_1_4.py (convert_cite_engine, revert_cite_engine): new functions diff --git a/lib/lyx2lyx/lyx_1_4.py b/lib/lyx2lyx/lyx_1_4.py index 4ccb750d5e..df35fe8b5d 100644 --- a/lib/lyx2lyx/lyx_1_4.py +++ b/lib/lyx2lyx/lyx_1_4.py @@ -1322,6 +1322,29 @@ def revert_cite_engine(header, opt): header.insert(i, "\\use_natbib " + use_natbib) +def convert_paperpackage(header, opt): + i = find_token(header, "\\paperpackage", 0) + if i == -1: + opt.warning("Malformed lyx file: Missing '\\paperpackage'") + return + + packages = {'a4':'none', 'a4wide':'a4', 'widemarginsa4':'a4wide'} + paperpackage = split(header[i])[1] + header[i] = replace(header[i], paperpackage, packages[paperpackage]) + + +def revert_paperpackage(header, opt): + i = find_token(header, "\\paperpackage", 0) + if i == -1: + opt.warning("Malformed lyx file: Missing '\\paperpackage'") + return + + packages = {'none':'a4', 'a4':'a4wide', 'a4wide':'widemarginsa4', + 'widemarginsa4':''} + paperpackage = split(header[i])[1] + header[i] = replace(header[i], paperpackage, packages[paperpackage]) + + ## # Convertion hub # @@ -1396,8 +1419,18 @@ def convert(header, body, opt): if opt.format < 234: convert_cite_engine(header, opt) opt.format = 234 + if opt.end == opt.format: return + + if opt.format < 235: + convert_paperpackage(header, opt) + opt.format = 235 def revert(header, body, opt): + if opt.format > 234: + revert_paperpackage(header, opt) + opt.format = 234 + if opt.end == opt.format: return + if opt.format > 233: revert_cite_engine(header, opt) opt.format = 233 diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py index 4c698903b5..0d346205bf 100644 --- a/lib/lyx2lyx/parser_tools.py +++ b/lib/lyx2lyx/parser_tools.py @@ -265,7 +265,7 @@ def set_version(lines, version): format_re = re.compile(r"(\d)[\.,]?(\d\d)") fileformat = re.compile(r"\\lyxformat\s*(\S*)") lst_ft = [210, 215, 216, 217, 218, 220, 221, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234] + 230, 231, 232, 233, 234, 235] format_relation = [("0_10", [210], ["0.10.7","0.10"]), ("0_12", [215], ["0.12","0.12.1","0.12"]), @@ -277,7 +277,7 @@ format_relation = [("0_10", [210], ["0.10.7","0.10"]), ("1_1_6fix3", [218], ["1.1.6fix3","1.1.6fix4","1.1"]), ("1_2", [220], ["1.2.0","1.2.1","1.2.3","1.2.4","1.2"]), ("1_3", [221], ["1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3"]), - ("1_4", [223,224,225,226,227,228,229,230,231,232,233,234], ["1.4.0cvs","1.4"])] + ("1_4", [223,224,225,226,227,228,229,230,231,232,233,234,235], ["1.4.0cvs","1.4"])] def lyxformat(format, opt): diff --git a/src/ChangeLog b/src/ChangeLog index 2fd6dc1ba8..24d2f33559 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-07-01 Georg Baum + + * buffer.C: up LYX_FORMAT to 235 (needed for the paperpackage fix) + 2004-06-29 Jean-Marc Lasgouttes * paragraph.C (isWord): return true on insets that report diff --git a/src/buffer.C b/src/buffer.C index 94bdf87d91..d2f07cf19e 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -136,7 +136,7 @@ extern BufferList bufferlist; namespace { -const int LYX_FORMAT = 234; +const int LYX_FORMAT = 235; } // namespace anon -- 2.39.2