-def convert(file):
- header_update(file.header, file)
- add_end_document(file.body)
- remove_cursor(file.body)
- final_dot(file.body)
- update_inset_label(file.body)
- update_latexdel(file.body)
- update_space_units(file.body)
- update_inset_accent(file.body)
- space_before_layout(file.body)
- formula_inset_space_eat(file.body)
- update_tabular(file.body)
- update_vfill(file.body)
- remove_empty_insets(file.body)
- remove_formula_latex(file.body)
- update_latexaccents(file)
- file.format = 215
-
-
-def revert(file):
- file.error("The convertion to an older format (%s) is not implemented." % file.format)
+def obsolete_latex_title(document):
+ " Replace layout Latex_Title with Title."
+ body = document.body
+ i = 0
+ while 1:
+ i = find_token(body, '\\layout', i)
+ if i == -1:
+ return
+
+ if body[i].lower().find('latex_title') != -1:
+ body[i] = '\\layout Title'
+
+ i = i + 1
+
+
+def remove_inset_latex(document):
+ "Replace inset latex with layout LaTeX"
+ body = document.body
+
+ i = 0
+ while 1:
+ i = find_token(body, '\\begin_inset Latex', i)
+ if i == -1:
+ return
+
+ body[i] = body[i].replace('\\begin_inset Latex', '\\layout LaTeX')
+ i = find_token(body, '\\end_inset', i)
+ if i == -1:
+ #this should not happen
+ return
+ del body[i]
+
+
+supported_versions = ["0.12.0","0.12.1","0.12"]
+convert = [[215, [header_update, add_end_document, remove_cursor,
+ final_dot, update_inset_label, update_latexdel,
+ update_space_units, space_before_layout,
+ formula_inset_space_eat, update_tabular,
+ update_vfill, remove_empty_insets,
+ remove_formula_latex, update_latexaccents,
+ obsolete_latex_title, remove_inset_latex]]]
+revert = []