[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    [LyX/2.1.x] Fix an off-by-one error in the reversion of beamer documents. (cherry picked from commit
From:       Richard Heck <rgheck () lyx ! org>
Date:       2014-05-29 15:28:53
Message-ID: 20140529152853.9C8D32802B6 () lyx ! lyx ! org
[Download RAW message or body]

commit 20214ee224f0bb83dda183852cbfdc37619b57b8
Author: Enrico Forestieri <forenr@lyx.org>
Date:   Thu May 29 10:55:30 2014 +0200

    Fix an off-by-one error in the reversion of beamer documents.
    (cherry picked from commit dbd4d781dcbe73d347a76fed9ca51faf2841e133)

diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py
index 0c170d4..eccf522 100644
--- a/lib/lyx2lyx/lyx_2_1.py
+++ b/lib/lyx2lyx/lyx_2_1.py
@@ -3621,12 +3621,12 @@ def revert_newframes(document):
             continue
         endseq = j
         subst = ["\\begin_layout %s" % frame_dict[val]]
-        esubst = ["\\begin_layout EndFrame", "", "\\end_layout"]
+        esubst = ["", "\\begin_layout EndFrame", "", "\\end_layout"]
         endseq = endseq + len(esubst) - len(document.body[j : j])
         if document.body[j] == "\\end_deeper":
-            document.body[j : j] = [""] + esubst
-        else:
             document.body[j : j] = esubst
+        else:
+            document.body[j+1 : j+1] = esubst
         for q in range(i, j):
             if document.body[q] == "\\begin_layout %s" % val:
                 document.body[q] = "\\begin_layout %s" % document.default_layout

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic