]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathTabular.cpp
Implement the suggestion by Andre'
[features.git] / src / mathed / InsetMathTabular.cpp
index 8d59cbd1df4e6bf241e8374bd082825ae2932f9e..099089169908b92a318d66a24fb2375f9c7c5725 100644 (file)
@@ -65,14 +65,7 @@ void InsetMathTabular::draw(PainterInfo & pi, int x, int y) const
 
 void InsetMathTabular::write(WriteStream & os) const
 {
-       // This is a text mode tabular, so close any previous \ensuremath
-       // command and set the proper mode.
-       if (os.latex() && os.pendingBrace()) {
-               os.pendingBrace(false);
-               os << '}';
-       }
-       bool textmode = os.textMode();
-       os.textMode(true);
+       ModeSpecifier specifier(os, TEXT_MODE);
 
        if (os.fragile())
                os << "\\protect";
@@ -90,8 +83,6 @@ void InsetMathTabular::write(WriteStream & os) const
        os << "\\end{" << name_ << '}';
        // adding a \n here is bad if the tabular is the last item
        // in an \eqnarray...
-
-       os.textMode(textmode);
 }