]> git.lyx.org Git - features.git/commitdiff
Rename \\quotes_language to\\quotes_style
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 Dec 2016 17:54:07 +0000 (18:54 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 Dec 2016 17:54:07 +0000 (18:54 +0100)
File format change.

development/FORMAT
lib/lyx2lyx/lyx_2_3.py
src/BufferParams.cpp
src/tex2lyx/Preamble.cpp
src/version.h

index 49acc05db33278f4507cb5486c32b78004bea7d6..999ff2a902ba0e431494ac0dd8f5c87e9d32ace5 100644 (file)
@@ -11,6 +11,9 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2016-12-20 Jürgen Spitzmüller <spitz@lyx.org>
+       * Format incremented to 519: rename \quotes_language to \quotes_style.
+
 2016-12-13 Richard Heck <rgheck@lyx.org>
        * Format incremeneted to 518: iopart.layout now includes
          stdlayouts.inc.
index 322f495991e508d8088ce018642f56d0e9662940..35975bce8e8637165ae7822b6b6bf7b4644e2127 100644 (file)
@@ -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, []],
index ef12e2ccbb72bcda59539a4214c25cb0021f4fc3..487f0341b37a88b1f539f033dffe3cc1e3dd1232 100644 (file)
@@ -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
index 93a3b044fa1d13591561c0a49c972808d87258fd..96df0a0f70cc1f540dfab76d7933acd9aa481b23 100644 (file)
@@ -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";
index 15fb8ee0771d6cbf069defa5207dde7fb9845d8c..fecef7b2ded7679984f81a50305be944da901643 100644 (file)
@@ -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