]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_arrayinset.C
Fix reading of math macros
[lyx.git] / src / mathed / math_arrayinset.C
index e0cb5bed158abfd5db9006787a91b78d44330cee..6bddbe3be5429fd80c0ba2b69616250726649ce1 100644 (file)
@@ -68,10 +68,15 @@ MathInset * MathArrayInset::clone() const
 
 void MathArrayInset::metrics(MathMetricsInfo & mi) const
 {
-       MathMetricsInfo m = mi;
-       if (m.base.style == LM_ST_DISPLAY)
-               m.base.style = LM_ST_TEXT;
-       MathGridInset::metrics(m);
+       MathArrayChanger dummy(mi.base);
+       MathGridInset::metrics(mi);
+}
+
+
+void MathArrayInset::draw(MathPainterInfo & pi, int x, int y) const
+{
+       MathArrayChanger dummy(pi.base);
+       MathGridInset::draw(pi, x, y);
 }
 
 
@@ -79,7 +84,7 @@ void MathArrayInset::write(WriteStream & os) const
 {
        if (os.fragile())
                os << "\\protect";
-       os << "\\begin{" << name_ << "}";
+       os << "\\begin{" << name_ << '}';
 
        if (v_align_ == 't' || v_align_ == 'b')
                os << '[' << char(v_align_) << ']';
@@ -89,15 +94,17 @@ void MathArrayInset::write(WriteStream & os) const
 
        if (os.fragile())
                os << "\\protect";
-       os << "\\end{" << name_ << "}\n";
+       os << "\\end{" << name_ << '}';
+       // adding a \n here is bad if the array is the last item
+       // in an \eqnarray...
 }
 
 
 void MathArrayInset::normalize(NormalStream & os) const
 {
-       os << "[" << name_ << " ";
+       os << '[' << name_ << ' ';
        MathGridInset::normalize(os);
-       os << "]";
+       os << ']';
 }
 
 
@@ -105,5 +112,5 @@ void MathArrayInset::maplize(MapleStream & os) const
 {
        os << "array(";
        MathGridInset::maplize(os);
-       os << ")";
+       os << ')';
 }