]> git.lyx.org Git - features.git/commitdiff
Output default mathindent value as "default"
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 24 May 2017 13:40:36 +0000 (15:40 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 7 Jun 2017 08:53:37 +0000 (10:53 +0200)
This is like parindent now. The old code would avoid outputing the
value when it was empty (default indentation).

Fixes bug #10657.

src/BufferParams.cpp

index 24aaf02c510a175e2d35731b1adb0b6ae25d5e0b..38ca643400698da1c4247edc177423ac02437896 100644 (file)
@@ -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: