]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathScript.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathScript.cpp
index 6bf53dd79900d4af5cd4a30c212e29013962b9ea..8a6c25808022a14835ffb6bdb344a848077eb733 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -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);
 }