#include <config.h>
#include "InsetMathExFunc.h"
+
#include "MathData.h"
#include "MathStream.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)
{}
-InsetMathExFunc::InsetMathExFunc(docstring const & name, MathArray const & ar)
+InsetMathExFunc::InsetMathExFunc(docstring const & name, MathData const & ar)
: InsetMathNest(1), name_(name)
{
cell(0) = ar;
}
-auto_ptr<InsetBase> InsetMathExFunc::doClone() const
+Inset * InsetMathExFunc::clone() const
{
- return auto_ptr<InsetBase>(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;
}
void InsetMathExFunc::mathmlize(MathStream & os) const
{
- os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str());
+ ++os.tab(); os.cr(); os.os() << '<' << name_ << '>';
+ os << cell(0);
+ os.cr(); --os.tab(); os.os() << "</" << name_ << '>';
}