From a9b5b1ff9a8d9307584686fc1e63fc3c871b40bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Mon, 8 Oct 2007 23:40:23 +0000 Subject: [PATCH] Fileformat incremented to 293 due to yesterdays' support for japanese-plain (r20831) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20859 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/FORMAT | 4 ++++ lib/lyx2lyx/LyX.py | 2 +- lib/lyx2lyx/lyx_1_6.py | 24 ++++++++++++++++++++++-- src/Buffer.cpp | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index 21563b9c79..27515d22d1 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,10 @@ LyX file-format changes ----------------------- +2007-10-09 Uwe Stöhr Uwe Stöhr + * Format incremented to 292: Support for Japanese without + using CJK and inputenc. (japanese-plain) + 2007-10-04 Uwe Stöhr Uwe Stöhr * Format incremented to 291: Support for Vietnamese. diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index cbb863467d..4ad73b439b 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -80,7 +80,7 @@ format_relation = [("0_06", [200], minor_versions("0.6" , 4)), ("1_3", [221], minor_versions("1.3" , 7)), ("1_4", range(222,246), minor_versions("1.4" , 5)), ("1_5", range(246,277), minor_versions("1.5" , 1)), - ("1_6", range(277,292), minor_versions("1.6" , 0))] # Uwe Stöhr, Vietnamese + ("1_6", range(277,293), minor_versions("1.6" , 0))] # Uwe Stöhr, Japanese def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index 4dd314c076..2ace8c29eb 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -420,6 +420,24 @@ def revert_vietnamese(document): j = j + 1 +def revert_japanese(document): + "Set language japanese-plain to japanese" + # Set document language from japanese-plain to japanese + i = 0 + if document.language == "japanese-plain": + document.language = "japanese" + i = find_token(document.header, "\\language", 0) + if i != -1: + document.header[i] = "\\language japanese" + j = 0 + while True: + j = find_token(document.body, "\\lang japanese-plain", j) + if j == -1: + return + document.body[j] = document.body[j].replace("\\lang japanese-plain", "\\lang japanese") + j = j + 1 + + ## # Conversion hub # @@ -439,10 +457,12 @@ convert = [[277, [fix_wrong_tables]], [288, [convert_inset_command]], [289, [convert_latexcommand_index]], [290, []], - [291, []] + [291, []], + [292, []] ] -revert = [[290, [revert_vietnamese]], +revert = [[291, [revert_japanese]], + [290, [revert_vietnamese]], [289, [revert_wraptable]], [288, [revert_latexcommand_index]], [287, [revert_inset_command]], diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 4d24cf9c04..d636790cb4 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -154,7 +154,7 @@ namespace fs = boost::filesystem; namespace { -int const LYX_FORMAT = 291; //Uwe Stöhr, Vietnamese +int const LYX_FORMAT = 292; //Uwe Stöhr, Japanese } // namespace anon