]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathDelim.cpp
Introduce a return value for mathmlize(). We will need this to be able
[features.git] / src / mathed / InsetMathDelim.cpp
index 95a172ea64afff055fcef0c0c1463e230f9c4ac5..6da49562eb6347e47cc5a88849bd3ffc273f06c5 100644 (file)
@@ -14,6 +14,7 @@
 #include "InsetMathDelim.h"
 
 #include "MathData.h"
+#include "MathExtern.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "MetricsInfo.h"
@@ -38,14 +39,15 @@ static docstring convertDelimToLatexName(docstring const & name)
 }
 
 
-InsetMathDelim::InsetMathDelim(docstring const & l, docstring const & r)
-       : InsetMathNest(1), left_(l), right_(r)
+InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l,
+               docstring const & r)
+       : InsetMathNest(buf, 1), left_(l), right_(r)
 {}
 
 
-InsetMathDelim::InsetMathDelim
-               (docstring const & l, docstring const & r, MathData const & ar)
-       : InsetMathNest(1), left_(l), right_(r)
+InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r,
+       MathData const & ar)
+       : InsetMathNest(buf, 1), left_(l), right_(r)
 {
        cell(0) = ar;
 }
@@ -160,10 +162,12 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const
 }
 
 
-void InsetMathDelim::mathmlize(MathStream & os) const
+docstring InsetMathDelim::mathmlize(MathStream & os) const
 {
-       os << "<fenced open=\"" << left_ << "\" close=\""
-               << right_ << "\">" << cell(0) << "</fenced>";
+       os << "<mo form='prefix' fence='true' stretchy='true' symmetric='true'>" << left_ << "</mo>";
+       docstring const rv = lyx::mathmlize(cell(0),os);
+       os << "<mo form='postfix' fence='true' stretchy='true' symmetric='true'>" << right_ << "</mo>";
+       return rv;
 }