X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathXYMatrix.cpp;h=9be4e2efa6c67e3ad63bb8ec2f6976e3c6972632;hb=90837aaf6eee523fd594c0ea7f44c053bb49a3cf;hp=367d522e51fd28a15aebb383610be83704eac0be;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/mathed/InsetMathXYMatrix.cpp b/src/mathed/InsetMathXYMatrix.cpp index 367d522e51..9be4e2efa6 100644 --- a/src/mathed/InsetMathXYMatrix.cpp +++ b/src/mathed/InsetMathXYMatrix.cpp @@ -11,11 +11,11 @@ #include #include "InsetMathXYMatrix.h" -#include "MathStream.h" #include "LaTeXFeatures.h" -#include "support/std_ostream.h" +#include "MathStream.h" +#include namespace lyx { @@ -25,9 +25,9 @@ InsetMathXYMatrix::InsetMathXYMatrix(Length const & s, char c) {} -std::auto_ptr InsetMathXYMatrix::doClone() const +Inset * InsetMathXYMatrix::clone() const { - return std::auto_ptr(new InsetMathXYMatrix(*this)); + return new InsetMathXYMatrix(*this); } @@ -43,20 +43,23 @@ int InsetMathXYMatrix::rowsep() const } -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': @@ -75,6 +78,7 @@ void InsetMathXYMatrix::write(WriteStream & os) const os << '{'; InsetMathGrid::write(os); os << "}\n"; + os.pendingBrace(brace); }