Author: jrioux
Date: Mon Nov  7 19:36:56 2011
New Revision: 40155
URL: http://www.lyx.org/trac/changeset/40155

Log:
File format bump after r39982 (renaming of the japanese encodings for pLaTeX).

LyX file format incremented to 417.

Modified:
   lyx-devel/trunk/development/FORMAT
   lyx-devel/trunk/lib/lyx2lyx/lyx_2_1.py
   lyx-devel/trunk/src/version.h

Modified: lyx-devel/trunk/development/FORMAT
==============================================================================
--- lyx-devel/trunk/development/FORMAT  Mon Nov  7 00:24:40 2011        (r40154)
+++ lyx-devel/trunk/development/FORMAT  Mon Nov  7 19:36:56 2011        (r40155)
@@ -11,6 +11,10 @@
 
 -----------------------
 
+2011-11-07 Julien Rioux ([email protected])
+       * Format incremented to 417 (r39982 and r40155)
+         Rename the japanese encodings to names understood by pLaTeX.
+
 2011-08-29 Uwe Stöhr <[email protected]>
        * Format incremented to 416 (r39557)
          support for \negmedspace and \negthinspace outside of math

Modified: lyx-devel/trunk/lib/lyx2lyx/lyx_2_1.py
==============================================================================
--- lyx-devel/trunk/lib/lyx2lyx/lyx_2_1.py      Mon Nov  7 00:24:40 2011        
(r40154)
+++ lyx-devel/trunk/lib/lyx2lyx/lyx_2_1.py      Mon Nov  7 19:36:56 2011        
(r40155)
@@ -162,17 +162,51 @@
       i = i + 1
 
 
+def convert_japanese_encodings(document):
+    " Rename the japanese encodings to names understood by platex "
+    jap_enc_dict = {
+        "EUC-JP-pLaTeX": "euc",
+        "JIS-pLaTeX":    "jis",
+        "SJIS-pLaTeX":   "sjis"
+    }
+    i = find_token(document.header, "\\inputencoding" , 0)
+    if i == -1:
+        return
+    val = get_value(document.header, "\\inputencoding", i)
+    if val in jap_enc_dict.keys():
+        document.header[i] = "\\inputencoding %s" % jap_enc_dict[val]
+
+
+def revert_japanese_encodings(document):
+    " Revert the japanese encodings name changes "
+    jap_enc_dict = {
+        "euc":  "EUC-JP-pLaTeX",
+        "jis":  "JIS-pLaTeX",
+        "sjis": "SJIS-pLaTeX"
+    }
+    i = find_token(document.header, "\\inputencoding" , 0)
+    if i == -1:
+        return
+    val = get_value(document.header, "\\inputencoding", i)
+    if val in jap_enc_dict.keys():
+        document.header[i] = "\\inputencoding %s" % jap_enc_dict[val]
+
+
 ##
 # Conversion hub
 #
 
 supported_versions = ["2.1.0","2.1"]
-convert = [[414, []],
+convert = [
+           [414, []],
            [415, [convert_undertilde]],
-           [416, []]
+           [416, []],
+           [417, [convert_japanese_encodings]],
           ]
 
-revert =  [[415, [revert_negative_space,revert_math_spaces]],
+revert =  [
+           [416, [revert_japanese_encodings]],
+           [415, [revert_negative_space,revert_math_spaces]],
            [414, [revert_undertilde]],
            [413, [revert_visible_space]]
           ]

Modified: lyx-devel/trunk/src/version.h
==============================================================================
--- lyx-devel/trunk/src/version.h       Mon Nov  7 00:24:40 2011        (r40154)
+++ lyx-devel/trunk/src/version.h       Mon Nov  7 19:36:56 2011        (r40155)
@@ -30,8 +30,8 @@
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 416 //uwestoehr : support for horizontal spaces (bug 
7728)
-#define LYX_FORMAT_TEX2LYX 416
+#define LYX_FORMAT_LYX 417 // jrioux : rename the japanese encodings
+#define LYX_FORMAT_TEX2LYX 417
 
 #if LYX_FORMAT_FOR_TEX2LYX != LYX_FORMAT_FOR_LYX
 #warning "tex2lyx produces an out of date file format."

Reply via email to