The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit ef541d474cd0da1dec6fe202989009d64524c912
Author: Juergen Spitzmueller <[email protected]>
Date:   Thu Dec 20 13:29:04 2012 +0100

    Improve overprint conversion.
    
    Deeply nested sequences are still problematic.

diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py
index 952d65b..2e3ba47 100644
--- a/lib/lyx2lyx/lyx_2_1.py
+++ b/lib/lyx2lyx/lyx_2_1.py
@@ -2732,7 +2732,11 @@ def convert_overprint(document):
             continue
         endseq = j
         subst = ["\\begin_layout Standard"] + 
put_cmd_in_ert("\\begin{overprint}")
-        esubst = ["\\end_layout", "", "\\begin_layout Standard"] + 
put_cmd_in_ert("\\end{overprint}") + ["\\end_layout"]
+        esubst = list()
+        if document.body[j] == "\\end_deeper":
+            esubst = ["", "\\begin_layout Standard"] + 
put_cmd_in_ert("\\end{overprint}") + ["\\end_layout"]
+        else:
+            esubst = ["\\end_layout", "", "\\begin_layout Standard"] + 
put_cmd_in_ert("\\end{overprint}") + ["\\end_layout"]
         endseq = endseq + len(esubst) - len(document.body[j : j])
         document.body[j : j] = esubst
         argbeg = find_token(document.body, "\\begin_inset Argument 1", i, j)
diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py
index 9af9b60..d043f92 100644
--- a/lib/lyx2lyx/parser_tools.py
+++ b/lib/lyx2lyx/parser_tools.py
@@ -106,7 +106,9 @@ find_end_of_layout(lines, i):
 
 find_end_of_sequence(lines, i):
   Find the end of the sequence of layouts of the same kind.
-  Considers nesting.
+  Considers nesting. If the last paragraph in sequence is nested,
+  the position of the last \end_deeper is returned, else
+  the position of the last \end_layout.
 
 is_in_inset(lines, i, inset):
   Checks if line i is in an inset of the given type.
@@ -513,6 +515,7 @@ def find_end_of_sequence(lines, i):
           j = find_end_of(lines, i, "\\begin_deeper", "\\end_deeper")
           if j != -1:
               i = j
+              endlay = j
               continue
       if m and m.group(1) == layout:
           endlay = find_end_of_layout(lines, i)

-----------------------------------------------------------------------

Summary of changes:
 lib/lyx2lyx/lyx_2_1.py      |    6 +++++-
 lib/lyx2lyx/parser_tools.py |    5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to