From: Juergen Spitzmueller Date: Tue, 20 Dec 2016 17:54:07 +0000 (+0100) Subject: Rename \\quotes_language to\\quotes_style X-Git-Tag: 2.3.0alpha1~591 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=857506e9924dec72df8d364762ef866b446baf11;p=features.git Rename \\quotes_language to\\quotes_style File format change. --- diff --git a/development/FORMAT b/development/FORMAT index 49acc05db3..999ff2a902 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -11,6 +11,9 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx. ----------------------- +2016-12-20 Jürgen Spitzmüller + * Format incremented to 519: rename \quotes_language to \quotes_style. + 2016-12-13 Richard Heck * Format incremeneted to 518: iopart.layout now includes stdlayouts.inc. diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py index 322f495991..35975bce8e 100644 --- a/lib/lyx2lyx/lyx_2_3.py +++ b/lib/lyx2lyx/lyx_2_3.py @@ -646,6 +646,26 @@ def convert_iopart(document): document.header[k : l + 1] = [] +def convert_quotestyle(document): + " Convert \\quotes_language to \\quotes_style " + i = find_token(document.header, "\\quotes_language", 0) + if i == -1: + document.warning("Malformed LyX document! Can't find \\quotes_language!") + return + val = get_value(document.header, "\\quotes_language", i) + document.header[i] = "\\quotes_style " + val + + +def revert_quotestyle(document): + " Revert \\quotes_style to \\quotes_language " + i = find_token(document.header, "\\quotes_style", 0) + if i == -1: + document.warning("Malformed LyX document! Can't find \\quotes_style!") + return + val = get_value(document.header, "\\quotes_style", i) + document.header[i] = "\\quotes_language " + val + + ## # Conversion hub # @@ -661,10 +681,12 @@ convert = [ [515, []], [516, [convert_inputenc]], [517, []], - [518, [convert_iopart]] + [518, [convert_iopart]], + [519, [convert_quotestyle]] ] revert = [ + [518, [revert_quotestyle]], [517, [revert_iopart]], [516, [revert_quotes]], [515, []], diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index ef12e2ccbb..487f0341b3 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -828,10 +828,10 @@ string BufferParams::readToken(Lexer & lex, string const & token, if (pimpl_->defskip.kind() == VSpace::DEFSKIP) // that is invalid pimpl_->defskip = VSpace(VSpace::MEDSKIP); - } else if (token == "\\quotes_language") { - string quotes_style; - lex >> quotes_style; - quotes_style = quotesstyletranslator().find(quotes_style); + } else if (token == "\\quotes_style") { + string qstyle; + lex >> qstyle; + quotes_style = quotesstyletranslator().find(qstyle); } else if (token == "\\papersize") { string ppsize; lex >> ppsize; @@ -1299,7 +1299,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const os << "\n\\paragraph_indentation " << getIndentation().asLyXCommand(); else os << "\n\\defskip " << getDefSkip().asLyXCommand(); - os << "\n\\quotes_language " + os << "\n\\quotes_style " << string_quotes_style[quotes_style] << "\n\\papercolumns " << columns << "\n\\papersides " << sides diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 93a3b044fa..96df0a0f70 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1253,7 +1253,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled os << "\\defskip " << h_defskip << "\n"; else os << "\\paragraph_indentation " << h_paragraph_indentation << "\n"; - os << "\\quotes_language " << h_quotes_style << "\n" + os << "\\quotes_style " << h_quotes_style << "\n" << "\\papercolumns " << h_papercolumns << "\n" << "\\papersides " << h_papersides << "\n" << "\\paperpagestyle " << h_paperpagestyle << "\n"; diff --git a/src/version.h b/src/version.h index 15fb8ee077..fecef7b2de 100644 --- a/src/version.h +++ b/src/version.h @@ -32,8 +32,8 @@ extern char const * const lyx_version_info; // Do not remove the comment below, so we get merge conflict in // independent branches. Instead add your own. -#define LYX_FORMAT_LYX 518 // rgheck: changes to iopart.layout -#define LYX_FORMAT_TEX2LYX 518 +#define LYX_FORMAT_LYX 519 // spitz: \\quotes_language -> \\quotes_style +#define LYX_FORMAT_TEX2LYX 519 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX #ifndef _MSC_VER