]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathExFunc.cpp
Introduce a return value for mathmlize(). We will need this to be able
[features.git] / src / mathed / InsetMathExFunc.cpp
index 7b03387ba3abc06d96c0833a985c244ea04e9499..173436eb612a7b031f1b2f862cab3cac734d297f 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -13,6 +13,7 @@
 #include "InsetMathExFunc.h"
 
 #include "MathData.h"
+#include "MathExtern.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "MetricsInfo.h"
@@ -24,13 +25,13 @@ using namespace std;
 namespace lyx {
 
 
-InsetMathExFunc::InsetMathExFunc(docstring const & name)
-       : InsetMathNest(1), name_(name)
+InsetMathExFunc::InsetMathExFunc(Buffer * buf, docstring const & name)
+       : InsetMathNest(buf, 1), name_(name)
 {}
 
 
-InsetMathExFunc::InsetMathExFunc(docstring const & name, MathData const & ar)
-       : InsetMathNest(1), name_(name)
+InsetMathExFunc::InsetMathExFunc(Buffer * buf, docstring const & name, MathData const & ar)
+       : InsetMathNest(buf, 1), name_(name)
 {
        cell(0) = ar;
 }
@@ -45,8 +46,6 @@ Inset * InsetMathExFunc::clone() const
 void InsetMathExFunc::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        mathed_string_dim(mi.base.font, name_, dim);
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
 }
 
 
@@ -124,11 +123,10 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const
 }
 
 
-void InsetMathExFunc::mathmlize(MathStream & os) const
+docstring InsetMathExFunc::mathmlize(MathStream & os) const
 {
-       ++os.tab(); os.cr(); os.os() << '<' << name_ << '>';
-       os << cell(0);
-       os.cr(); --os.tab(); os.os() << "</" << name_ << '>';
+       os << "<mi>" << name_ << "</mi><mo>&af;</mo>";
+       return lyx::mathmlize(cell(0), os);
 }