From e472c2b740bc49a1f916aeda0a337e711913d0c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Fri, 3 Dec 2004 18:39:51 +0000 Subject: [PATCH] File format up to 238. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9337 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/FORMAT | 17 +++++++++++++++++ lib/lyx2lyx/ChangeLog | 7 +++++++ lib/lyx2lyx/LyX.py | 2 +- lib/lyx2lyx/lyx_0_12.py | 9 +++++++-- lib/lyx2lyx/lyx_1_4.py | 8 ++++++-- src/ChangeLog | 4 ++++ src/buffer.C | 2 +- 7 files changed, 43 insertions(+), 6 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index e6667e0533..b62e5278e8 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,23 @@ LyX file-format changes ----------------------- +2004-12-03 José Matos + + * format up to 238. + * The compatibility code to read old latex accents from 0.12.x in + InsetLatexAccent::checkContents has been removed. + The following translations are done: + "\i \x" -> "\i \x{}" + "\i \xy" -> "\i \x{y}" + "\i \x y" -> "\i \x{y}" + "\i \x\i" -> "\i \x{\i}" + "\i \x\j" -> "\i \x{\j}" + x is a latex accent command, y the base character. \, i and j are + literal. + lyx did these changes already from 0.12.x -> 215, but not lyx2lyx, + so formats 215 - 237 can have both versions. + + 2004-10-10 José Matos * format up to 237. diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index 2242723567..1ea2300f4b 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,10 @@ +2004-12-03 José Matos + + * LyX.py: format up to 238. + * lyx_1_4.py: + * lyx_0_12.py (update_latexaccents): consider the cases where the + inset is updated. + 2004-12-03 José Matos * lyx_1_2.py (update_longtable): Update longtables to table format 3. diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index ec6e129787..4f7da03332 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -44,7 +44,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.5","1.3"]), - ("1_4", range(223,238), ["1.4.0cvs","1.4"])] + ("1_4", range(223,239), ["1.4.0cvs","1.4"])] def formats_list(): diff --git a/lib/lyx2lyx/lyx_0_12.py b/lib/lyx2lyx/lyx_0_12.py index b8bb35d2de..414b0c9303 100644 --- a/lib/lyx2lyx/lyx_0_12.py +++ b/lib/lyx2lyx/lyx_0_12.py @@ -236,7 +236,8 @@ def header_update(lines, file): i = i + 1 -def update_latexaccents(body): +def update_latexaccents(file): + body = file.body i = 1 while 1: i = find_token(body, '\\i ', i) @@ -245,6 +246,10 @@ def update_latexaccents(body): contents = string.strip(body[i][2:]) + if string.find(contents, '{') != -1 and string.find(contents, '}') != -1: + i = i + 1 + continue + if len(contents) == 2: contents = contents + '{}' elif len(contents) == 3: @@ -274,7 +279,7 @@ def convert(file): update_vfill(file.body) remove_empty_insets(file.body) remove_formula_latex(file.body) - update_latexaccents(file.body) + update_latexaccents(file) file.format = 215 diff --git a/lib/lyx2lyx/lyx_1_4.py b/lib/lyx2lyx/lyx_1_4.py index 6cdc0391b4..06232610d4 100644 --- a/lib/lyx2lyx/lyx_1_4.py +++ b/lib/lyx2lyx/lyx_1_4.py @@ -26,6 +26,8 @@ from parser_tools import find_token, find_end_of_inset, get_next_paragraph, \ from sys import stdin from string import replace, split, find, strip, join +from lyx_0_12 import update_latexaccents + ## # Remove \color default # @@ -1526,7 +1528,8 @@ def convert(file): 235 : [convert_paperpackage], 236 : [convert_bullets, add_begin_header, add_begin_body, normalize_papersize, strip_end_space], - 237 : [use_x_boolean]} + 237 : [use_x_boolean], + 238 : [update_latexaccents]} chain = table.keys() chain.sort() @@ -1542,7 +1545,8 @@ def convert(file): def revert(file): - table = { 236: [use_x_binary], + table = { 237: [], + 236: [use_x_binary], 235: [denormalize_papersize, remove_begin_body,remove_begin_header, revert_bullets], 234: [revert_paperpackage], diff --git a/src/ChangeLog b/src/ChangeLog index e5b901bb95..199c28c866 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-12-03 José Matos + + * buffer.C: format up to 238. + 2004-12-03 José Matos * tabular.[Ch]: remove setHeaderFooterRows as this code is never called. diff --git a/src/buffer.C b/src/buffer.C index 21740256db..37ec8955e8 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -136,7 +136,7 @@ extern BufferList bufferlist; namespace { -const int LYX_FORMAT = 237; +const int LYX_FORMAT = 238; } // namespace anon -- 2.39.2