From: Uwe Stöhr Date: Mon, 29 Oct 2007 22:38:36 +0000 (+0000) Subject: fileformat change for my previous commit: Albanian and lower Sorbian support X-Git-Tag: 1.6.10~7610 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=bb46fe5f0e94e768cc4269c1f8418479189bfa9a;p=lyx.git fileformat change for my previous commit: Albanian and lower Sorbian support git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21273 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 4792590d03..55754c0a56 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" , 2)), - ("1_6", range(277,297), minor_versions("1.6" , 0))] # RGH: InsetInclude + ("1_6", range(277,298), minor_versions("1.6" , 0))] # Uwe: Albanian, lower Sorbian def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index a776447b56..4f992e2b86 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -516,6 +516,7 @@ def convert_htmlurl(document): document.body[i + 1] = "LatexCommand href" i = i + 1 + def convert_url(document): 'Convert url insets to url charstyles' if document.backend == "docbook": @@ -570,6 +571,7 @@ def convert_url(document): return document.header.insert(i + 1, "URL") + def revert_href(document): 'Reverts hyperlink insets (href) to url insets (url)' i = 0 @@ -581,6 +583,7 @@ def revert_href(document): ["\\begin_inset CommandInset url", "LatexCommand url"] i = i + 2 + def convert_include(document): 'Converts include insets to new format.' i = 0 @@ -609,6 +612,7 @@ def convert_include(document): document.body[i : i + 2] = insertion i += newlines + def revert_include(document): 'Reverts include insets to old format.' i = 0 @@ -647,7 +651,43 @@ def revert_include(document): insertion = [newline, previewline] document.body[i : i + numlines] = insertion i += 2 - + + +def revert_albanian(document): + "Set language Albanian to English" + # Set document language from Vietnamese to English + i = 0 + if document.language == "albanian": + document.language = "english" + i = find_token(document.header, "\\language", 0) + if i != -1: + document.header[i] = "\\language english" + j = 0 + while True: + j = find_token(document.body, "\\lang albanian", j) + if j == -1: + return + document.body[j] = document.body[j].replace("\\lang albanian", "\\lang english") + j = j + 1 + + +def revert_lowersorbian(document): + "Set language lower Sorbian to English" + # Set document language from Vietnamese to English + i = 0 + if document.language == "lowersorbian": + document.language = "english" + i = find_token(document.header, "\\language", 0) + if i != -1: + document.header[i] = "\\language english" + j = 0 + while True: + j = find_token(document.body, "\\lang lowersorbian", j) + if j == -1: + return + document.body[j] = document.body[j].replace("\\lang lowersorbian", "\\lang english") + j = j + 1 + ## # Conversion hub @@ -673,10 +713,12 @@ convert = [[277, [fix_wrong_tables]], [293, []], [294, [convert_pdf_options]], [295, [convert_htmlurl, convert_url]], - [296, [convert_include]] + [296, [convert_include]], + [297, []] ] -revert = [[295, [revert_include]], +revert = [[296, [revert_albanian, revert_lowersorbian]], + [295, [revert_include, revert_albanian, revert_lowersorbian]], [294, [revert_href]], [293, [revert_pdf_options_2]], [292, [revert_inset_info]], diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 0df77cfce3..192113da7d 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -156,7 +156,7 @@ namespace fs = boost::filesystem; namespace { -int const LYX_FORMAT = 296; //RGH: InsetInclude changes +int const LYX_FORMAT = 297; //Uwe: Albanian, lower Sorbian } // namespace anon