mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Use insert_document_option to remove Georgian when reverting.
Less code for the same functionality. :-)
This commit is contained in:
parent
08182ead14
commit
94905f9ce3
@ -24,15 +24,8 @@ import sys, os
|
||||
|
||||
# Uncomment only what you need to import, please.
|
||||
|
||||
#from parser_tools import find_token, find_end_of, find_tokens, \
|
||||
# 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, get_option_value
|
||||
|
||||
from lyx2lyx_tools import (add_to_preamble, put_cmd_in_ert, get_ert,
|
||||
lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets)
|
||||
# insert_to_preamble, latex_length, revert_flex_inset,
|
||||
# revert_font_attrs, hex2ratio, str2bool
|
||||
lyx2latex, lyx2verbatim, length_in_bp, convert_info_insets, insert_document_option)
|
||||
|
||||
from parser_tools import (check_token, del_complete_lines,
|
||||
find_end_of_inset, find_end_of_layout, find_nonempty_line, find_re,
|
||||
@ -865,12 +858,7 @@ def revert_georgian(document):
|
||||
j = find_token(document.header, "\\language_package default", 0)
|
||||
if j != -1:
|
||||
document.header[j] = "\\language_package babel"
|
||||
k = find_token(document.header, "\\options", 0)
|
||||
if k != -1:
|
||||
document.header[k] = document.header[k].replace("\\options", "\\options georgian,")
|
||||
else:
|
||||
l = find_token(document.header, "\\use_default_options", 0)
|
||||
document.header.insert(l + 1, "\\options georgian")
|
||||
insert_document_option(document, "georgian")
|
||||
|
||||
|
||||
def revert_sigplan_doi(document):
|
||||
|
Loading…
Reference in New Issue
Block a user