* 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.
*/
namespace lyx {
-InsetMathTabular::InsetMathTabular(docstring const & name, int m, int n)
- : InsetMathGrid(m, n), name_(name)
+InsetMathTabular::InsetMathTabular(Buffer * buf, docstring const & name, int m,
+ int n)
+ : InsetMathGrid(buf, m, n), name_(name)
{}
-InsetMathTabular::InsetMathTabular(docstring const & name, int m, int n,
- char valign, docstring const & halign)
- : InsetMathGrid(m, n, valign, halign), name_(name)
+InsetMathTabular::InsetMathTabular(Buffer * buf, docstring const & name, int m,
+ int n, char valign, docstring const & halign)
+ : InsetMathGrid(buf, m, n, valign, halign), name_(name)
{}
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";
os << "\\end{" << name_ << '}';
// adding a \n here is bad if the tabular is the last item
// in an \eqnarray...
-
- os.textMode(textmode);
}