# 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
+ lyx2verbatim, length_in_bp, convert_info_insets
# insert_to_preamble, latex_length, revert_flex_inset, \
# revert_font_attrs, hex2ratio, str2bool
revert_verbatim(document, True)
+def convert_save_props(document):
+ " Add save_transient_properties parameter. "
+ i = find_token(document.header, '\\begin_header', 0)
+ if i == -1:
+ document.warning("Malformed lyx document: Missing '\\begin_header'.")
+ return
+ document.header.insert(i + 1, '\\save_transient_properties true')
+
+
+def revert_save_props(document):
+ " Remove save_transient_properties parameter. "
+ i = find_token(document.header, "\\save_transient_properties", 0)
+ if i == -1:
+ return
+ del document.header[i]
+
+
+def convert_info_tabular_feature(document):
+ def f(arg):
+ return arg.replace("inset-modify tabular", "tabular-feature")
+ convert_info_insets(document, "shortcut(s)?|icon", f)
+
+
+def revert_info_tabular_feature(document):
+ def f(arg):
+ return arg.replace("tabular-feature", "inset-modify tabular")
+ convert_info_insets(document, "shortcut(s)?|icon", f)
+
+
##
# Conversion hub
#
[500, []],
[501, [convert_fontsettings]],
[502, []],
- [503, []]
+ [503, []],
+ [504, [convert_save_props]],
+ [505, []],
+ [506, [convert_info_tabular_feature]]
]
revert = [
+ [505, [revert_info_tabular_feature]],
+ [504, []],
+ [503, [revert_save_props]],
[502, [revert_verbatim_star]],
[501, [revert_solution]],
[500, [revert_fontsettings]],