]> git.lyx.org Git - lyx.git/blobdiff - lib/lyx2lyx/lyx_2_2.py
Inherit "Provides color" in *-article.layout
[lyx.git] / lib / lyx2lyx / lyx_2_2.py
index 53614206f6a3affe8b98512ebd9ee758c1675790..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
 
@@ -2186,11 +2186,11 @@ def revert_verbatim_star(document):
 
 def convert_save_props(document):
     " Add save_transient_properties parameter. "
-    i = find_token(document.header, '\\origin', 0)
+    i = find_token(document.header, '\\begin_header', 0)
     if i == -1:
-        document.warning("Malformed lyx document: Missing '\\origin'.")
+        document.warning("Malformed lyx document: Missing '\\begin_header'.")
         return
-    document.header.insert(i, '\\save_transient_properties true')
+    document.header.insert(i + 1, '\\save_transient_properties true')
 
 
 def revert_save_props(document):
@@ -2201,6 +2201,18 @@ def revert_save_props(document):
     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
 #
@@ -2239,10 +2251,14 @@ convert = [
            [501, [convert_fontsettings]],
            [502, []],
            [503, []],
-           [504, [convert_save_props]]
+           [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]],