mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix bugs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22506 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
efbbf7a31f
commit
df4634968a
@ -404,7 +404,7 @@ class LyX_base:
|
||||
return
|
||||
j = find_token(self.header, "\\end_modules", i)
|
||||
if j == -1:
|
||||
self.warning("Malformed LyX document: No \\end_modules.")
|
||||
self.warning("(add_module)Malformed LyX document: No \\end_modules.")
|
||||
return
|
||||
k = find_token(self.header, module, i)
|
||||
if k != -1 and k < j:
|
||||
@ -422,15 +422,19 @@ class LyX_base:
|
||||
|
||||
def set_module_list(self, mlist):
|
||||
modbegin = find_token(self.header, "\\begin_modules", 0)
|
||||
newmodlist = ['\\begin_modules'] + mlist + ['\\end_modules']
|
||||
if (modbegin == -1):
|
||||
#No modules yet included
|
||||
modbegin = find_token(self.header, "\\textclass", 0)
|
||||
if modbegin == -1:
|
||||
tclass = find_token(self.header, "\\textclass", 0)
|
||||
if tclass == -1:
|
||||
self.warning("Malformed LyX document: No \\textclass!!")
|
||||
return
|
||||
modbegin = tclass + 1
|
||||
self.header[modbegin:modbegin] = newmodlist
|
||||
return
|
||||
modend = find_token(self.header, "\\end_modules", modbegin)
|
||||
if modend == -1:
|
||||
self.warning("Malformed LyX document: No \\end_modules.")
|
||||
self.warning("(set_module_list)Malformed LyX document: No \\end_modules.")
|
||||
return
|
||||
newmodlist = ['\\begin_modules'] + mlist + ['\\end_modules']
|
||||
self.header[modbegin:modend + 1] = newmodlist
|
||||
|
@ -929,6 +929,8 @@ def convert_module_names(document):
|
||||
'Theorems (Order By Chapter)' : 'theorems-chap', 'Theorems (Order By Section)' : 'theorems-sec', \
|
||||
'Theorems (Starred)' : 'theorems-starred', 'Theorems' : 'theorems-std' }
|
||||
modlist = document.get_module_list()
|
||||
if len(modlist) == 0:
|
||||
return
|
||||
newmodlist = []
|
||||
for mod in modlist:
|
||||
if modulemap.has_key(mod):
|
||||
@ -946,6 +948,8 @@ def revert_module_names(document):
|
||||
'theorems-chap' : 'Theorems (Order By Chapter)', 'theorems-sec' : 'Theorems (Order By Section)', \
|
||||
'theorems-starred' : 'Theorems (Starred)', 'theorems-std' : 'Theorems'}
|
||||
modlist = document.get_module_list()
|
||||
if len(modlist) == 0:
|
||||
return
|
||||
newmodlist = []
|
||||
for mod in modlist:
|
||||
if modulemap.has_key(mod):
|
||||
|
Loading…
Reference in New Issue
Block a user