From 01f5efbe13052ac5d0f082a77d888f20b0fdc39e Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 17 Aug 2024 16:19:10 +0200 Subject: [PATCH] fix lyx2lyx functions --- lib/lyx2lyx/lyx_2_5.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_5.py b/lib/lyx2lyx/lyx_2_5.py index 193455227e..c93a3bfc21 100644 --- a/lib/lyx2lyx/lyx_2_5.py +++ b/lib/lyx2lyx/lyx_2_5.py @@ -653,7 +653,8 @@ def convert_index_sc(document): k = find_substring(document.body, ec, k, j) if k == -1: break - if get_containing_inset(document.body, k)[0] == "ERT": + inInset = get_containing_inset(document.body, k) + if inInset and inInset[0] == "ERT": k += 1 continue @@ -696,7 +697,8 @@ def revert_index_sc(document): k = find_substring(document.body, ec, k, j) if k == -1: break - if get_containing_inset(document.body, k)[0] == "ERT": + inInset = get_containing_inset(document.body, k) + if inInset and inInset[0] == "ERT": k += 1 continue