]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_2_2.py
In mathed, only select current cell on double-click
[lyx.git] / lib / lyx2lyx / lyx_2_2.py
index 5a639cd2393d18533af83e228d1f00f54c7ccbce..a1f3005d7e1b9351a3e4a9aeecac27f39bb62f19 100644 (file)
@@ -31,7 +31,7 @@ import sys, os
 #  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
 
@@ -2184,6 +2184,35 @@ def revert_verbatim_star(document):
     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
 #
@@ -2221,10 +2250,16 @@ convert = [
            [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]],