]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMath.cpp
* src/mathed/InsetMathHull.cpp:
[lyx.git] / src / mathed / InsetMath.cpp
index 0674d97382b58ffd19dc2f824518f12cd8369a05..fd8994652dcc6d609d6e37db64cda61cb35df4e2 100644 (file)
@@ -68,27 +68,13 @@ void InsetMath::drawT(TextPainter &, int, int) const
 
 void InsetMath::write(WriteStream & os) const
 {
-       bool brace = ensureMath(os);
+       MathEnsurer ensurer(os);
        docstring const s = name();
        os << "\\" << s;
        // We need an extra ' ' unless this is a single-char-non-ASCII name
        // or anything non-ASCII follows
        if (s.size() != 1 || isAlphaASCII(s[0]))
                os.pendingSpace(true);
-       os.pendingBrace(brace);
-}
-
-
-bool InsetMath::ensureMath(WriteStream & os, bool needs_math_mode) const
-{
-       bool brace = os.pendingBrace();
-       os.pendingBrace(false);
-       if (os.latex() && os.textMode() && needs_math_mode) {
-               os << "\\ensuremath{";
-               os.textMode(false);
-               brace = true;
-       }
-       return brace;
 }