]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSymbol.cpp
Fix bug 5802 (http://bugzilla.lyx.org/show_bug.cgi?id=5802)
[lyx.git] / src / mathed / InsetMathSymbol.cpp
index 28119d2a9ba6f05ef992e5ae02b38b4290bac2c7..8a1ba2fd1b4656d763b9d3b88d8ec95ace61058b 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.
  */
@@ -206,15 +206,8 @@ void InsetMathSymbol::octave(OctaveStream & os) const
 
 void InsetMathSymbol::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);
        os << '\\' << name();
-       os.pendingBrace(brace);
 
        // $,#, etc. In theory the restriction based on catcodes, but then
        // we do not handle catcodes very well, let alone cat code changes,