]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_matrixinset.C
Fix reading of math macros
[lyx.git] / src / mathed / math_matrixinset.C
index d8a02da555b5d13a930e0d3c52990c7bb35ed0f3..4cfedd59b45f5d462e0aed310ce4c9179cdb58b4 100644 (file)
@@ -8,8 +8,8 @@
 #include "Lsstream.h"
 
 
-MathMatrixInset::MathMatrixInset(MathArrayInset const & p)
-       : MathArrayInset(p)
+MathMatrixInset::MathMatrixInset(MathGridInset const & p)
+       : MathGridInset(p)
 {}
 
 
@@ -21,13 +21,13 @@ MathInset * MathMatrixInset::clone() const
 
 void MathMatrixInset::write(WriteStream & os) const
 {
-       MathArrayInset::write(os);
+       MathGridInset::write(os);
 }
 
 
 void MathMatrixInset::normalize(NormalStream & os) const
 {
-       MathArrayInset::normalize(os);
+       MathGridInset::normalize(os);
 }
 
 
@@ -43,16 +43,27 @@ void MathMatrixInset::maplize(MapleStream & os) const
 }
 
 
-void MathMatrixInset::mathmlize(MathMLStream & os) const
+void MathMatrixInset::maximize(MaximaStream & os) const
 {
-       os << MTag("mtable");
+       os << "matrix(";
        for (row_type row = 0; row < nrows(); ++row) {
-               os << MTag("mtr");
-               for (col_type col = 0; col < ncols(); ++col) 
+               if (row)
+                       os << ',';
+               os << '[';
+               for (col_type col = 0; col < ncols(); ++col) {
+                       if (col)
+                               os << ',';
                        os << cell(index(row, col));
-               os << ETag("mtr");
+               }
+               os << ']';
        }
-       os << ETag("mtable");
+       os << ')';
+}
+
+
+void MathMatrixInset::mathmlize(MathMLStream & os) const
+{
+       MathGridInset::mathmlize(os);
 }
 
 
@@ -63,7 +74,7 @@ void MathMatrixInset::octavize(OctaveStream & os) const
                if (row)
                        os << ';';
                os << '[';
-               for (col_type col = 0; col < ncols(); ++col) 
+               for (col_type col = 0; col < ncols(); ++col)
                        os << cell(index(row, col)) << ' ';
                os << ']';
        }