From 9cd9712cf088ff0f57c86ae95a85dd323b2f6ee2 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Fri, 28 Dec 2018 23:02:47 -0500 Subject: [PATCH] Fix bug #11378. (cherry picked from commit f11a51be35b54882e77d2cce189fedb2085412dd) --- lib/lyx2lyx/lyx2lyx_tools.py | 12 +++++++++++- status.23x | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py index f63f402616..ba179a78c6 100644 --- a/lib/lyx2lyx/lyx2lyx_tools.py +++ b/lib/lyx2lyx/lyx2lyx_tools.py @@ -450,7 +450,7 @@ def revert_font_attrs(lines, name, LaTeXname): while True: i = find_token(lines, name + ' on', i) if i == -1: - return changed + break j = find_token(lines, name + ' default', i) k = find_token(lines, name + ' on', i + 1) # if there is no default set, the style ends with the layout @@ -464,6 +464,16 @@ def revert_font_attrs(lines, name, LaTeXname): changed = True i += 1 + # now delete all remaining lines that manipulate this attribute + i = 0 + while True: + i = find_token(lines, name, i) + if i = -1: + break + del lines[i] + + return changed + def revert_layout_command(lines, name, LaTeXname): " Reverts a command from a layout to TeX code " diff --git a/status.23x b/status.23x index 26cb69799e..2490a673f7 100644 --- a/status.23x +++ b/status.23x @@ -99,6 +99,8 @@ What's new - Speed up some lyx2lyx conversions (bug 11200). +- Fix routine that left some old parameters unremoved (bug 11373). + * TEX2LYX -- 2.39.5