On Thursday 02 December 2004 17:16, Georg Baum wrote:
> Jose' Matos wrote:
> >   Any lyx version, starting from 0.12, has converted the inset latex
> >   accents
> > to the right format. So this is not a new change, this was a change in
> > the file format from 2.10 to 2.15.
>
> Yes, it was a change from 2.10 to 2.15, but it is also a new change,
> because up to now the old latex accents could be read by lyx, and this is
> not possible anymore.

  Does the attached patch solves the corner case?

> >   The only problem you could get into is if you converted the file with
> > lyx2lyx but never used it with lyx. Is this case worth consideration? I
> > don't think so but I am open to other suggestions.
>
> It is a corner case, but I think it should be considered since it is not
> much work. lyx format numbers are cheap since the lyx2lyx reorganization!
> I can do that if you want.
>
> The tabular compatibility code is different BTW: It can be removed
> without format change, because it is dead code for version 3 tabulars,
> and older tabulars are first converted by lyx2lyx to version 3.

  I agree. :-)

> Georg

-- 
José Abílio
Index: lib/lyx2lyx/LyX.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/LyX.py,v
retrieving revision 1.5
diff -u -p -r1.5 LyX.py
--- lib/lyx2lyx/LyX.py	28 Oct 2004 11:21:27 -0000	1.5
+++ lib/lyx2lyx/LyX.py	2 Dec 2004 18:05:18 -0000
@@ -44,7 +44,7 @@ format_relation = [("0_10",  [210], ["0.
                    ("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():
Index: lib/lyx2lyx/lyx_0_12.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx_0_12.py,v
retrieving revision 1.3
diff -u -p -r1.3 lyx_0_12.py
--- lib/lyx2lyx/lyx_0_12.py	2 Dec 2004 12:29:20 -0000	1.3
+++ lib/lyx2lyx/lyx_0_12.py	2 Dec 2004 18:05:18 -0000
@@ -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)
@@ -274,7 +275,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
 
 
Index: lib/lyx2lyx/lyx_1_4.py
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/lyx2lyx/lyx_1_4.py,v
retrieving revision 1.17
diff -u -p -r1.17 lyx_1_4.py
--- lib/lyx2lyx/lyx_1_4.py	26 Oct 2004 21:16:42 -0000	1.17
+++ lib/lyx2lyx/lyx_1_4.py	2 Dec 2004 18:05:18 -0000
@@ -26,6 +26,8 @@ from parser_tools import find_token, fin
 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],
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.594
diff -u -p -r1.594 buffer.C
--- src/buffer.C	25 Nov 2004 19:12:58 -0000	1.594
+++ src/buffer.C	2 Dec 2004 18:05:18 -0000
@@ -136,7 +136,7 @@ extern BufferList bufferlist;
 
 namespace {
 
-const int LYX_FORMAT = 237;
+const int LYX_FORMAT = 238;
 
 } // namespace anon
 

Reply via email to