From dfab2898de3a63f7ccb0144098846fda7008ebd7 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 21 Jul 2023 09:46:47 +0200 Subject: [PATCH] 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 file changed, 3 insertions(+) diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py index 33bf92c5c9..6e4bdbb362 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: