]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.cpp
* src/mathed/InsetMathHull.cpp:
[lyx.git] / src / mathed / InsetMathBox.cpp
index bb4ffc6944a4cad6b050dbb2362c6f5178eb0bca..603ea05b380dae32128e51a5fd4a8abaf35df39f 100644 (file)
@@ -39,10 +39,8 @@ InsetMathBox::InsetMathBox(docstring const & name)
 
 void InsetMathBox::write(WriteStream & os) const
 {
-       bool oldmode = os.textMode();
-       os.textMode(true);
+       ModeSpecifier specifier(os, TEXT_MODE);
        os << '\\' << name_ << '{' << cell(0) << '}';
-       os.textMode(oldmode);
 }
 
 
@@ -118,10 +116,8 @@ void InsetMathFBox::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathFBox::write(WriteStream & os) const
 {
-       bool oldmode = os.textMode();
-       os.textMode(true);
+       ModeSpecifier specifier(os, TEXT_MODE);
        os << "\\fbox{" << cell(0) << '}';
-       os.textMode(oldmode);
 }
 
 
@@ -217,8 +213,7 @@ void InsetMathMakebox::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathMakebox::write(WriteStream & os) const
 {
-       bool oldmode = os.textMode();
-       os.textMode(true);
+       ModeSpecifier specifier(os, TEXT_MODE);
        os << (framebox_ ? "\\framebox" : "\\makebox");
        if (cell(0).size() || !os.latex()) {
                os << '[' << cell(0) << ']';
@@ -226,7 +221,6 @@ void InsetMathMakebox::write(WriteStream & os) const
                        os << '[' << cell(1) << ']';
        }
        os << '{' << cell(2) << '}';
-       os.textMode(oldmode);
 }
 
 
@@ -275,10 +269,8 @@ void InsetMathBoxed::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathBoxed::write(WriteStream & os) const
 {
-       bool oldmode = os.textMode();
-       os.textMode(true);
+       ModeSpecifier specifier(os, MATH_MODE);
        os << "\\boxed{" << cell(0) << '}';
-       os.textMode(oldmode);
 }