mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
lyx2lyx: more descriptive member name (document.start -> document.initial_format)
This commit is contained in:
parent
37901e2e25
commit
463e12827c
@ -393,6 +393,7 @@ class LyX_base:
|
||||
self.inputencoding = get_value(self.header, b"\\inputencoding", 0,
|
||||
default = b"auto").decode('ascii')
|
||||
self.format = self.read_format()
|
||||
self.initial_format = self.format
|
||||
self.encoding = get_encoding(self.language,
|
||||
self.inputencoding, self.format,
|
||||
self.cjk_encoding)
|
||||
@ -698,7 +699,6 @@ class LyX_base:
|
||||
conversion are taken. It returns a list of modules needed to
|
||||
convert the LyX file from self.format to self.end_format"""
|
||||
|
||||
self.start = self.format
|
||||
format = self.format
|
||||
correct_version = 0
|
||||
|
||||
@ -732,7 +732,7 @@ class LyX_base:
|
||||
|
||||
# Convertion mode, back or forth
|
||||
steps = []
|
||||
if (initial_step, self.start) < (final_step, self.end_format):
|
||||
if (initial_step, self.initial_format) < (final_step, self.end_format):
|
||||
mode = "convert"
|
||||
full_steps = []
|
||||
for step in format_relation:
|
||||
|
@ -820,7 +820,7 @@ def revert_suppress_date(document):
|
||||
|
||||
def convert_mhchem(document):
|
||||
"Set mhchem to off for versions older than 1.6.x"
|
||||
if document.start < 277:
|
||||
if document.initial_format < 277:
|
||||
# LyX 1.5.x and older did never load mhchem.
|
||||
# Therefore we must switch it off: Documents that use mhchem have
|
||||
# a manual \usepackage anyway, and documents not using mhchem but
|
||||
|
@ -1846,7 +1846,7 @@ def convert_dashligatures(document):
|
||||
|
||||
i = find_token(document.header, "\\use_microtype", 0)
|
||||
if i != -1:
|
||||
if document.start > 474 and document.start < 509:
|
||||
if document.initial_format > 474 and document.initial_format < 509:
|
||||
# This was created by LyX 2.2
|
||||
document.header[i+1:i+1] = ["\\use_dash_ligatures false"]
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user