X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathSpace.cpp;h=7d44accf7bd2146919a953d62332611c67dd73aa;hb=11a6b3c4c7a031fd3776f53c9c43f62116933cea;hp=8d3df0930b28499ebd585483ec25fcbeec27948e;hpb=f497296c30e6da2f97b16da8ad1c9e96feffb16b;p=lyx.git diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index 8d3df0930b..7d44accf7b 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -15,13 +15,10 @@ #include "MathStream.h" #include "LaTeXFeatures.h" -#include "LColor.h" #include "frontends/Painter.h" -using std::string; -using std::auto_ptr; - +using namespace std; namespace lyx { @@ -75,21 +72,15 @@ InsetMathSpace::InsetMathSpace(docstring const & name) } -auto_ptr InsetMathSpace::doClone() const +Inset * InsetMathSpace::clone() const { - return auto_ptr(new InsetMathSpace(*this)); + return new InsetMathSpace(*this); } -bool InsetMathSpace::metrics(MetricsInfo &, Dimension & dim) const +void InsetMathSpace::metrics(MetricsInfo &, Dimension & dim) const { - dim.wid = width(); - dim.asc = ascent(); - dim.des = descent(); - if (dim_ == dim) - return false; - dim_ = dim; - return true; + dim = dim_; } @@ -102,14 +93,14 @@ void InsetMathSpace::draw(PainterInfo & pi, int x, int y) const int xp[4]; int yp[4]; - int w = width(); + int w = dim_.wid; xp[0] = ++x; yp[0] = y - 3; xp[1] = x; yp[1] = y; xp[2] = x + w - 2; yp[2] = y; xp[3] = x + w - 2; yp[3] = y - 3; - pi.pain.lines(xp, yp, 4, (space_ < 3) ? LColor::latex : LColor::math); + pi.pain.lines(xp, yp, 4, (space_ < 3) ? Color_latex : Color_math); }