]> 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 1b097e928e03b31957f0c793cad6d118c86f1dd0..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.
  */
 #include <config.h>
 
 #include "InsetMathExFunc.h"
+
 #include "MathData.h"
-#include "MathStream.h"
+#include "MathExtern.h"
 #include "MathStream.h"
 #include "MathSupport.h"
+#include "MetricsInfo.h"
 
+#include "support/docstream.h"
 
-namespace lyx {
+using namespace std;
 
-using std::auto_ptr;
-using std::vector;
-using std::string;
+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;
 }
 
 
-auto_ptr<Inset> InsetMathExFunc::doClone() const
+Inset * InsetMathExFunc::clone() const
 {
-       return auto_ptr<Inset>(new InsetMathExFunc(*this));
+       return new InsetMathExFunc(*this);
 }
 
 
-bool InsetMathExFunc::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathExFunc::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        mathed_string_dim(mi.base.font, name_, dim);
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
 }
 
 
@@ -126,9 +123,10 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const
 }
 
 
-void InsetMathExFunc::mathmlize(MathStream & os) const
+docstring InsetMathExFunc::mathmlize(MathStream & os) const
 {
-       os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
+       os << "<mi>" << name_ << "</mi><mo>&af;</mo>";
+       return lyx::mathmlize(cell(0), os);
 }