#include <config.h>
#include "InsetMathXYMatrix.h"
-#include "MathStream.h"
#include "LaTeXFeatures.h"
-#include "support/std_ostream.h"
+#include "MathStream.h"
+#include <ostream>
namespace lyx {
{}
-std::auto_ptr<Inset> InsetMathXYMatrix::doClone() const
+Inset * InsetMathXYMatrix::clone() const
{
- return std::auto_ptr<Inset>(new InsetMathXYMatrix(*this));
+ return new InsetMathXYMatrix(*this);
}
}
-bool InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathXYMatrix::metrics(MetricsInfo & mi, Dimension & dim) const
{
if (mi.base.style == LM_ST_DISPLAY)
mi.base.style = LM_ST_TEXT;
InsetMathGrid::metrics(mi, dim);
- if (dim_ == dim)
- return false;
- dim_ = dim;
- return true;
}
void InsetMathXYMatrix::write(WriteStream & os) const
{
+ bool brace = os.pendingBrace();
+ os.pendingBrace(false);
+ if (os.latex() && os.textMode()) {
+ os << "\\ensuremath{";
+ os.textMode(false);
+ brace = true;
+ }
os << "\\xymatrix";
switch (spacing_code_) {
case 'R':
os << '{';
InsetMathGrid::write(os);
os << "}\n";
+ os.pendingBrace(brace);
}