From 296632a2c33ed1f363078f60981f195598cfa908 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Matox?= Date: Mon, 19 Apr 2004 14:30:33 +0000 Subject: [PATCH] Fix revert chain. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8673 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/lyx2lyx/ChangeLog | 4 ++++ lib/lyx2lyx/parser_tools.py | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/lyx2lyx/ChangeLog b/lib/lyx2lyx/ChangeLog index 70e514ada0..2bd4869289 100644 --- a/lib/lyx2lyx/ChangeLog +++ b/lib/lyx2lyx/ChangeLog @@ -1,3 +1,7 @@ +2004-04-19 José Matos + * parser_tools.py (chain): fix the detection of the last format for + revertions. + 2004-04-19 Martin Vermeer * lyx_1_4.py (convert_frameless_box): Replace instead of adding new code. diff --git a/lib/lyx2lyx/parser_tools.py b/lib/lyx2lyx/parser_tools.py index 9b5a555909..95f60d22fc 100644 --- a/lib/lyx2lyx/parser_tools.py +++ b/lib/lyx2lyx/parser_tools.py @@ -341,11 +341,16 @@ def chain(opt, initial_version): steps.append(step[0]) else: mode = "revert" - for step in format_relation: + relation_format = format_relation + relation_format.reverse() + last_step = None + + for step in relation_format: if final_step <= step[0] <= initial_step: - steps.insert(0, step[0]) + steps.append(step[0]) + last_step = step - if step[1][-1:] == opt.end: - del steps[0] + if last_step[1][-1] == opt.end: + steps.pop() return mode, steps -- 2.39.2