Jose:

The test case of bug 3404 has multiple consecutive

\begin_deeper
\begin_deeper

\end_deeper
\end_deeper

and an \end_layout is inserted before each \begin_deeper. This leads
to excessive  \end_layout.

I am *not* familiar with lyx 1.3.x format and I do not know if there
are valid cases where multiple \begin_deeper should yield multiple
\end_layout. If you know the answer, the attached patch fixes bug
3404.

Cheers,
Bo

Index: lib/lyx2lyx/lyx_1_4.py
===================================================================
--- lib/lyx2lyx/lyx_1_4.py      (revision 19100)
+++ lib/lyx2lyx/lyx_1_4.py      (working copy)
@@ -466,6 +466,9 @@
            document.body.insert(i,"")
            document.body.insert(i,"\\end_layout")
            i = i + 3
+            # consecutive begin_deeper only insert one end_layout
+            while document.body[i].startswith('\\begin_deeper'):
+                i += 1
            struct_stack.append(token)
            continue
Index: lib/lyx2lyx/lyx_1_4.py
===================================================================
--- lib/lyx2lyx/lyx_1_4.py	(revision 19100)
+++ lib/lyx2lyx/lyx_1_4.py	(working copy)
@@ -466,6 +466,9 @@
             document.body.insert(i,"")
             document.body.insert(i,"\\end_layout")
             i = i + 3
+            # consecutive begin_deeper only insert one end_layout
+            while document.body[i].startswith('\\begin_deeper'):
+                i += 1
             struct_stack.append(token)
             continue
 

Reply via email to