]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathFrac.cpp
* src/mathed/InsetMathHull.cpp:
[lyx.git] / src / mathed / InsetMathFrac.cpp
index 58e0c1b1803998774f7008e3cc1f3c14c9b979f2..07e1c80502782e3058e36a97578423bd0f6b5a75 100644 (file)
@@ -265,14 +265,7 @@ void InsetMathFrac::drawT(TextPainter & /*pain*/, int /*x*/, int /*y*/) const
 
 void InsetMathFrac::write(WriteStream & os) const
 {
-       bool brace = os.pendingBrace();
-       os.pendingBrace(false);
-       if (os.latex() && os.textMode()) {
-               os << "\\ensuremath{";
-               os.textMode(false);
-               brace = true;
-       }
-
+       MathEnsurer ensurer(os);
        switch (kind_) {
        case ATOP:
                os << '{' << cell(0) << "\\atop " << cell(1) << '}';
@@ -296,8 +289,6 @@ void InsetMathFrac::write(WriteStream & os) const
                        os << "\\unit{" << cell(0) << '}';
                break;
        }
-
-       os.pendingBrace(brace);
 }
 
 
@@ -545,14 +536,7 @@ bool InsetMathBinom::extraBraces() const
 
 void InsetMathBinom::write(WriteStream & os) const
 {
-       bool brace = os.pendingBrace();
-       os.pendingBrace(false);
-       if (os.latex() && os.textMode()) {
-               os << "\\ensuremath{";
-               os.textMode(false);
-               brace = true;
-       }
-
+       MathEnsurer ensurer(os);
        switch (kind_) {
        case BINOM:
                os << "\\binom{" << cell(0) << "}{" << cell(1) << '}';
@@ -567,8 +551,6 @@ void InsetMathBinom::write(WriteStream & os) const
                os << '{' << cell(0) << " \\brack " << cell(1) << '}';
                break;
        }
-
-       os.pendingBrace(brace);
 }