]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathScript.cpp
fix off-by-two drawing error
[lyx.git] / src / mathed / InsetMathScript.cpp
index 6bf53dd79900d4af5cd4a30c212e29013962b9ea..5c4fcbfb3ed9919215e9dd56b1a72298b70aa9a5 100644 (file)
@@ -525,13 +525,7 @@ bool InsetMathScript::idxUpDown(Cursor & cur, bool up) const
 
 void InsetMathScript::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);
 
        if (nuc().size()) {
                os << nuc();
@@ -556,8 +550,6 @@ void InsetMathScript::write(WriteStream & os) const
 
        if (lock_ && !os.latex())
                os << "\\lyxlock ";
-
-       os.pendingBrace(brace);
 }