]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_deliminset.C
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / math_deliminset.C
index ed24aa851d6848d39d462e55d0333cfc77380925..bb7dbce5e994a1ed044588e52ceb93f50eddd44b 100644 (file)
@@ -1,8 +1,5 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "math_deliminset.h"
 #include "math_parser.h"
@@ -36,7 +33,7 @@ string convertDelimToLatexName(string const & name)
                return name;
        if (name == "|")
                return name;
-       return "\\" + name + " ";
+       return '\\' + name + ' ';
 }
 
 }
@@ -129,28 +126,35 @@ bool MathDelimInset::isAbs() const
 }
 
 
-void MathDelimInset::maplize(MapleStream & os) const
+void MathDelimInset::maple(MapleStream & os) const
 {
        if (isAbs()) {
-               bool mat =
-                       cell(0).size() == 1 && cell(0).begin()->nucleus()
-                                       && cell(0).begin()->nucleus()->asMatrixInset();
-               if (mat)
-                       os << "linalg[det](" << cell(0) << ")";
+               if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
+                       os << "linalg[det](" << cell(0) << ')';
                else
-                       os << "abs(" << cell(0) << ")";
+                       os << "abs(" << cell(0) << ')';
        }
        else
                os << left_ << cell(0) << right_;
 }
 
-void MathDelimInset::mathematicize(MathematicaStream & os) const
+void MathDelimInset::maxima(MaximaStream & os) const
 {
        if (isAbs()) {
-               bool mat =
-                       cell(0).size() == 1 && cell(0).begin()->nucleus()
-                                       && cell(0).begin()->nucleus()->asMatrixInset();
-               if (mat)
+               if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
+                       os << "determinant(" << cell(0) << ')';
+               else
+                       os << "abs(" << cell(0) << ')';
+       }
+       else
+               os << left_ << cell(0) << right_;
+}
+
+
+void MathDelimInset::mathematica(MathematicaStream & os) const
+{
+       if (isAbs()) {
+               if (cell(0).size() == 1 && cell(0).front()->asMatrixInset())
                        os << "Det" << cell(0) << ']';
                else
                        os << "Abs[" << cell(0) << ']';
@@ -160,7 +164,6 @@ void MathDelimInset::mathematicize(MathematicaStream & os) const
 }
 
 
-
 void MathDelimInset::mathmlize(MathMLStream & os) const
 {
        os << "<fenced open=\"" << left_ << "\" close=\""
@@ -168,10 +171,10 @@ void MathDelimInset::mathmlize(MathMLStream & os) const
 }
 
 
-void MathDelimInset::octavize(OctaveStream & os) const
+void MathDelimInset::octave(OctaveStream & os) const
 {
        if (isAbs())
-               os << "det(" << cell(0) << ")";
+               os << "det(" << cell(0) << ')';
        else
                os << left_ << cell(0) << right_;
 }