Enrico Forestieri wrote:
On Tue, Mar 18, 2008 at 07:11:47PM +0100, Edwin Leuven wrote:

would be nice if everybody who uses tables could check whether the conversion goes well (do the lines look ok?), and whether line setting makes sense (can you get the lines you could get before, etc).

Please find attached a file produced by LyX 1.3 which is not
correctly converted. LyX 1.5.4 is able to correctly load it, though.

with the attached patch your file correctly loads

the problem was that lyx 1.3 started tabular insets as follows

\begin_inset  Tabular
            ^^

that is two spaces whereas 1.5 had one space there

as a consequence the tabulars were not converted

because

find_token(document.body, "\\begin_inset Tabular", i)
                                        ^

(one space) doesn't find the inset

i don't know whether the attached way is the best way to solve this

it seems to work though

josé opinions about how to do this?

edwin

PS i will commit this in the meantime

Index: lib/lyx2lyx/lyx_1_6.py
===================================================================
--- lib/lyx2lyx/lyx_1_6.py	(revision 23820)
+++ lib/lyx2lyx/lyx_1_6.py	(working copy)
@@ -76,7 +76,9 @@
     while True:
         i = find_token(document.body, "\\begin_inset Tabular", i)
         if i == -1:
-            return
+            i = find_token(document.body, "\\begin_inset  Tabular", i)
+            if i == -1:
+                return
         j = find_end_of_inset(document.body, i + 1)
         if j == -1:
             document.warning("Malformed LyX document: Could not find end of tabular.")

Reply via email to