]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathExFunc.cpp
fix off-by-two drawing error
[lyx.git] / src / mathed / InsetMathExFunc.cpp
index 9ede0e43403f30a58e3231a16b5f34a4f5a83e8f..9a871f49d40c4fcd86e9c8261a6db9eed63c4c71 100644 (file)
 #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)
@@ -29,26 +29,22 @@ 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;
 }
 
 
@@ -128,7 +124,9 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const
 
 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_ << '>';
 }