From: Richard Heck Date: Fri, 5 Nov 2010 19:59:24 +0000 (+0000) Subject: Use find_token_exact so that we do not also find hspace*. X-Git-Tag: 2.0.0~1981 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6ec6e93815059d387e12c20649031189a96ec309;p=features.git Use find_token_exact so that we do not also find hspace*. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36136 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/lyx2lyx/lyx_2_0.py b/lib/lyx2lyx/lyx_2_0.py index 66d73f84e3..354e2f03f6 100644 --- a/lib/lyx2lyx/lyx_2_0.py +++ b/lib/lyx2lyx/lyx_2_0.py @@ -24,9 +24,9 @@ import unicodedata import sys, os from parser_tools import find_token, find_end_of, find_tokens, \ - find_end_of_inset, find_end_of_layout, find_token_backwards, \ - is_in_inset, get_value, get_quoted_value, del_token, \ - check_token + find_token_exact, find_end_of_inset, find_end_of_layout, \ + find_token_backwards, is_in_inset, get_value, get_quoted_value, \ + del_token, check_token from lyx2lyx_tools import add_to_preamble, insert_to_preamble, \ put_cmd_in_ert, lyx2latex, latex_length, revert_flex_inset, \ @@ -678,7 +678,7 @@ def revert_percent_hspace_lengths(document): " Revert relative HSpace lengths to ERT " i = 0 while True: - i = find_token(document.body, "\\begin_inset space \\hspace", i) + i = find_token_exact(document.body, "\\begin_inset space \\hspace", i) if i == -1: break j = find_end_of_inset(document.body, i) @@ -709,7 +709,7 @@ def revert_hspace_glue_lengths(document): " Revert HSpace glue lengths to ERT " i = 0 while True: - i = find_token(document.body, "\\begin_inset space \\hspace", i) + i = find_token_exact(document.body, "\\begin_inset space \\hspace", i) if i == -1: break j = find_end_of_inset(document.body, i) @@ -772,7 +772,7 @@ def revert_author_id(document): " Remove the author_id from the \\author definition " i = 0 anum = 0 - rx = re.compile(r'(\\author)\s+([-\d]+)\s+(\".*\")\s*(.*)$') + rx = re.compile(r'(\\author)\s+(\d+)\s+(\".*\")\s*(.*)$') idmap = dict() while True: @@ -2014,12 +2014,10 @@ convert = [[346, []], [401, []], [402, [convert_bibtex_clearpage]], [403, [convert_flexnames]], - [404, [convert_prettyref]], - [405, []] + [404, [convert_prettyref]] ] -revert = [[404, []], - [403, [revert_refstyle]], +revert = [[403, [revert_refstyle]], [402, [revert_flexnames]], [401, []], [400, [revert_diagram]],