X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathEnv.cpp;h=a7fb33c69d408ac0e7aa704b879dd3d19698f5dd;hb=55a3dd7b346d29a52ba305a4558e9e380ef50f47;hp=e70b09cb1fb50f6ebffd4bd1ef9c336cae38db75;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/mathed/InsetMathEnv.cpp b/src/mathed/InsetMathEnv.cpp index e70b09cb1f..a7fb33c69d 100644 --- a/src/mathed/InsetMathEnv.cpp +++ b/src/mathed/InsetMathEnv.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,38 +11,31 @@ #include #include "InsetMathEnv.h" + #include "MathData.h" #include "MathStream.h" #include "MathStream.h" -#include "support/std_ostream.h" - -namespace lyx { +#include -using std::string; -using std::auto_ptr; - +namespace lyx { -InsetMathEnv::InsetMathEnv(docstring const & name) - : InsetMathNest(1), name_(name) +InsetMathEnv::InsetMathEnv(Buffer * buf, docstring const & name) + : InsetMathNest(buf, 1), name_(name) {} -auto_ptr InsetMathEnv::doClone() const +Inset * InsetMathEnv::clone() const { - return auto_ptr(new InsetMathEnv(*this)); + return new InsetMathEnv(*this); } -bool InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathEnv::metrics(MetricsInfo & mi, Dimension & dim) const { cell(0).metrics(mi, dim); metricsMarkers(dim); - if (dim_ == dim) - return false; - dim_ = dim; - return true; } @@ -55,6 +48,7 @@ void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const void InsetMathEnv::write(WriteStream & os) const { + MathEnsurer ensurer(os); os << "\\begin{" << name_ << '}' << cell(0) << "\\end{" << name_ << '}'; }