[LyX/master] Fix lyx2lyx reversion problem for covington examples

Juergen Spitzmueller spitz at lyx.org
Fri Jul 21 06:34:56 UTC 2023


commit dfab2898de3a63f7ccb0144098846fda7008ebd7
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Fri Jul 21 09:46:47 2023 +0200

    Fix lyx2lyx reversion problem for covington examples
    
    Do not take arguments of nested insets/layouts as your own
---
 lib/lyx2lyx/lyx_2_4.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index 33bf92c..6e4bdbb 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -5296,6 +5296,9 @@ def revert_exarg2(document):
                      continue
 
             arg = find_token(document.body, "\\begin_inset Argument 1", i, l)
+            if arg != -1 and layouttype != "\\begin_layout " + get_containing_layout(document.body, arg)[0]:
+                 # this is not our argument!
+                 arg = -1
             if subexpl or arg == -1:
                 iarg = find_token(document.body, "\\begin_inset Argument item:1", i, l)
                 if iarg == -1:


More information about the lyx-cvs mailing list