]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_arrayinset.C
Fix.
[lyx.git] / src / mathed / math_arrayinset.C
index d785b4cede6cb2707d87007380641cd5d78c058f..83e756a574863d9bd53de32f31d1bce4877c95aa 100644 (file)
@@ -1,12 +1,10 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_arrayinset.h"
 #include "math_parser.h"
 #include "math_mathmlstream.h"
+#include "math_metricsinfo.h"
 #include "math_streamstr.h"
 #include "Lsstream.h"
 
@@ -67,10 +65,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);
 }
 
 
@@ -78,7 +81,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_) << ']';
@@ -88,21 +91,23 @@ 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 << ']';
 }
 
 
-void MathArrayInset::maplize(MapleStream & os) const
+void MathArrayInset::maple(MapleStream & os) const
 {
        os << "array(";
-       MathGridInset::maplize(os);
-       os << ")";
+       MathGridInset::maple(os);
+       os << ')';
 }