]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathExFunc.cpp
Assure correct spacing of colored items in mathed
[lyx.git] / src / mathed / InsetMathExFunc.cpp
index 990040ef7c91001ba3ec030790ff3731f3f8b26b..9782e25cf3ff2aefdbe56b06d53aa1ca5fdf9cc1 100644 (file)
@@ -24,13 +24,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;
 }
@@ -44,7 +44,7 @@ Inset * InsetMathExFunc::clone() const
 
 void InsetMathExFunc::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       mathed_string_dim(mi.base.font, name_, dim);
+       metricsStrRedBlack(mi, dim, name_);
 }
 
 
@@ -122,11 +122,21 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const
 }
 
 
-void InsetMathExFunc::mathmlize(MathStream & os) const
+void InsetMathExFunc::mathmlize(MathStream & ms) const
 {
-       ++os.tab(); os.cr(); os.os() << '<' << name_ << '>';
-       os << cell(0);
-       os.cr(); --os.tab(); os.os() << "</" << name_ << '>';
+       ms << "<" << from_ascii(ms.namespacedTag("mi")) << ">"
+          << name_
+       << "</" << from_ascii(ms.namespacedTag("mi")) << ">"
+          << "<" << from_ascii(ms.namespacedTag("mo")) << ">"
+          << "&af;"
+          << "</" << from_ascii(ms.namespacedTag("mo")) << ">"
+          << cell(0);
+}
+
+
+void InsetMathExFunc::htmlize(HtmlStream & os) const
+{
+       os << name_ << cell(0);
 }