X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathEnv.cpp;h=41263562cde8d37a90a5d99f9bddd7f6152a4861;hb=d85cf3218a14f5b7419dbc6b6796e65ff5dbfc74;hp=110d09b2597bda01cbd4fdabc8bc0961efbd28d0;hpb=31059d1741933d95403e7f07ed033cae482f778b;p=lyx.git diff --git a/src/mathed/InsetMathEnv.cpp b/src/mathed/InsetMathEnv.cpp index 110d09b259..41263562cd 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,43 +11,44 @@ #include #include "InsetMathEnv.h" + #include "MathData.h" #include "MathStream.h" #include "MathStream.h" -#include "support/std_ostream.h" +#include "MetricsInfo.h" -namespace lyx { +#include "support/gettext.h" +#include "support/lstrings.h" +#include -using std::string; -using std::auto_ptr; +using namespace lyx::support; +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 { + Changer dummy = mi.base.changeEnsureMath(); cell(0).metrics(mi, dim); - metricsMarkers(dim); - if (dim_ == dim) - return false; - dim_ = dim; - return true; + metricsMarkers(mi, dim); } void InsetMathEnv::draw(PainterInfo & pi, int x, int y) const { + Changer dummy = pi.base.changeEnsureMath(); cell(0).draw(pi, x + 1, y); drawMarkers(pi, x, y); } @@ -55,6 +56,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_ << '}'; } @@ -67,7 +69,7 @@ void InsetMathEnv::normalize(NormalStream & os) const void InsetMathEnv::infoize(odocstream & os) const { - os << "Env: " << name_; + os << bformat(_("Environment: %1$s"), name_); }