X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Flyx2lyx%2Flyx2lyx_tools.py;h=80cfdd39cf4a62d1f86a38ab9a0cd7b26d37ff6c;hb=f11a51be35b54882e77d2cce189fedb2085412dd;hp=73f7d78c10cfcdb76e877c40e4ebabf78c45eeb9;hpb=f92107c68e2e8b9d6a861e09e96ed444f12e9dba;p=lyx.git diff --git a/lib/lyx2lyx/lyx2lyx_tools.py b/lib/lyx2lyx/lyx2lyx_tools.py index 73f7d78c10..80cfdd39cf 100644 --- a/lib/lyx2lyx/lyx2lyx_tools.py +++ b/lib/lyx2lyx/lyx2lyx_tools.py @@ -465,7 +465,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 @@ -479,6 +479,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 "