From 2a2f15ec03e1771a5d9ac26d0c71784de4d8e5f1 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Sun, 14 Jun 2020 15:33:06 -0400 Subject: [PATCH] Fix bug noticed by Scott. Since there may be subfloats, we do not want to move past the end of a float when modifying it. --- lib/lyx2lyx/lyx_2_4.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py index 22cc874a7b..f3c2fdc1c3 100644 --- a/lib/lyx2lyx/lyx_2_4.py +++ b/lib/lyx2lyx/lyx_2_4.py @@ -744,7 +744,9 @@ def revert_floatalignment(document): alcmd = put_cmd_in_ert("\\raggedleft{}") if len(alcmd) > 0: document.body[l+1:l+1] = alcmd - i = j + # There might be subfloats, so we do not want to move past + # the end of the inset. + i += 1 def revert_tuftecite(document): """Revert \cite commands in tufte classes""" -- 2.39.2