From: Jean-Marc Lasgouttes Date: Wed, 24 May 2017 13:40:36 +0000 (+0200) Subject: Output default mathindent value as "default" X-Git-Tag: 2.3.0beta1~310 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=83cd3f4293a3a17f09abfbe55fd4a30418a6ba9d;p=features.git Output default mathindent value as "default" This is like parindent now. The old code would avoid outputing the value when it was empty (default indentation). Fixes bug #10657. --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 24aaf02c51..38ca643400 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -866,7 +866,11 @@ string BufferParams::readToken(Lexer & lex, string const & token, lex >> is_math_indent; } else if (token == "\\math_indentation") { lex.next(); - pimpl_->mathindent = Length(lex.getString()); + string mathindent = lex.getString(); + if (mathindent == "default") + pimpl_->mathindent = Length(); + else + pimpl_->mathindent = Length(mathindent); } else if (token == "\\math_numbering_side") { string tmp; lex >> tmp; @@ -1377,8 +1381,9 @@ 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 && !getMathIndent().empty()) - os << "\n\\math_indentation " << getMathIndent().asString(); + if (is_math_indent) + os << "\n\\math_indentation " + << (getMathIndent().empty() ? "default" : getMathIndent().asString()); os << "\n\\math_numbering_side "; switch(math_numbering_side) { case LEFT: