X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathComment.cpp;h=b8c157b2c2cff3e46d70f3b30399419af781eca4;hb=2de30c62f8d671a8c8d4d52a6a7310e2c5ca84de;hp=ca0de54262e6d6b7e4bad023fa39eced24c485cb;hpb=f497296c30e6da2f97b16da8ad1c9e96feffb16b;p=lyx.git diff --git a/src/mathed/InsetMathComment.cpp b/src/mathed/InsetMathComment.cpp index ca0de54262..b8c157b2c2 100644 --- a/src/mathed/InsetMathComment.cpp +++ b/src/mathed/InsetMathComment.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,45 +11,46 @@ #include #include "InsetMathComment.h" + #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" -#include "support/std_ostream.h" + +#include namespace lyx { -using std::string; -using std::auto_ptr; +InsetMathComment::InsetMathComment(Buffer * buf) + : InsetMathNest(buf, 1) +{} -InsetMathComment::InsetMathComment() - : InsetMathNest(1) -{} +InsetMathComment::InsetMathComment(MathData const & ar) + : InsetMathNest(const_cast(ar.buffer()), 1) +{ + cell(0) = ar; +} -InsetMathComment::InsetMathComment(docstring const & str) - : InsetMathNest(1) +InsetMathComment::InsetMathComment(Buffer * buf, docstring const & str) + : InsetMathNest(buf, 1) { // FIXME UNICODE asArray(str, cell(0)); } -auto_ptr InsetMathComment::doClone() const +Inset * InsetMathComment::clone() const { - return auto_ptr(new InsetMathComment(*this)); + return new InsetMathComment(*this); } -bool InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathComment::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); - metricsMarkers(dim); - if (dim_ == dim) - return false; - dim_ = dim; - return true; + metricsMarkers(mi, dim); } @@ -84,17 +85,15 @@ void InsetMathComment::maple(MapleStream & os) const } -void InsetMathComment::mathematica(MathematicaStream &) const -{} - - -void InsetMathComment::octave(OctaveStream &) const -{} +void InsetMathComment::mathmlize(MathStream & os) const +{ + os << MTag("comment") << cell(0) << ETag("comment"); +} -void InsetMathComment::mathmlize(MathStream & os) const +void InsetMathComment::htmlize(HtmlStream & os) const { - os << MTag("comment") << cell(0) << cell(1) << ETag("comment"); + os << ""; }