From 3677c20be90b07045cb67305bb5b950edae5794e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20St=C3=B6hr?= Date: Sat, 15 Apr 2017 17:32:58 +0200 Subject: [PATCH] BufferParams.cpp: correct output for \mathindent after [fc1c5c6f/lyxgit] - also adapt the lyx2lyx logic to the changed implementation --- lib/lyx2lyx/lyx_2_3.py | 7 ++++--- src/BufferParams.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py index 76130c838d..5857b82a74 100644 --- a/lib/lyx2lyx/lyx_2_3.py +++ b/lib/lyx2lyx/lyx_2_3.py @@ -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: diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 19abefc0dd..1c00dbdd97 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -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]