]> git.lyx.org Git - features.git/commitdiff
BufferParams.cpp: correct output for \mathindent after [fc1c5c6f/lyxgit]
authorUwe Stöhr <uwestoehr@lyx.org>
Sat, 15 Apr 2017 15:32:58 +0000 (17:32 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Sat, 15 Apr 2017 15:32:58 +0000 (17:32 +0200)
- also adapt the lyx2lyx logic to the changed implementation

lib/lyx2lyx/lyx_2_3.py
src/BufferParams.cpp

index 76130c838ddd547b21c9a55ea2d3b4fdee8f52b4..5857b82a749a3a7163c0ffdb0e174d7a15238521 100644 (file)
@@ -2000,11 +2000,12 @@ def revert_mathindent(document):
         add_to_preamble(document, ["\\setlength{\\mathindent}{" + value + '}'])
         del document.header[i]
     # now set the document class option
-    regexp = re.compile(r'(\\is_math_indent)')
+    regexp = re.compile(r'(\\is_math_indent 1)')
     i = find_re(document.header, regexp, 0)
-    value = "1"
     if i == -1:
-        return
+        regexp = re.compile(r'(\\is_math_indent)')
+        j = find_re(document.header, regexp, 0)
+        del document.header[j]
     else:    
         k = find_token(document.header, "\\options", 0)
         if k != -1:
index 19abefc0dd9706fd872c284aa9f14af470368482..1c00dbdd977f6c6f9523477cd03ecad27533e237 100644 (file)
@@ -1348,7 +1348,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
        else
                os << "\n\\defskip " << getDefSkip().asLyXCommand();
        os << "\n\\is_math_indent " << is_math_indent;
-       if (is_math_indent)
+       if (is_math_indent && getMathIndentation().asLyXCommand() != "default")
                os << "\n\\math_indentation " << getMathIndentation().asLyXCommand();
        os << "\n\\quotes_style "
           << string_quotes_style[quotes_style]