X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathExFunc.cpp;h=e4e1f10c2e2b8daa099bcb490185c58828f1a798;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=1b097e928e03b31957f0c793cad6d118c86f1dd0;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/mathed/InsetMathExFunc.cpp b/src/mathed/InsetMathExFunc.cpp index 1b097e928e..e4e1f10c2e 100644 --- a/src/mathed/InsetMathExFunc.cpp +++ b/src/mathed/InsetMathExFunc.cpp @@ -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. */ @@ -11,44 +11,40 @@ #include #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) - : 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 InsetMathExFunc::doClone() const +Inset * InsetMathExFunc::clone() const { - return auto_ptr(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; + metricsStrRedBlack(mi, dim, name_); } @@ -128,7 +124,14 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const void InsetMathExFunc::mathmlize(MathStream & os) const { - os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str()); + os << "" << name_ << ""; + os << cell(0); +} + + +void InsetMathExFunc::htmlize(HtmlStream & os) const +{ + os << name_ << cell(0); }