X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathSpace.cpp;h=7d44accf7bd2146919a953d62332611c67dd73aa;hb=11a6b3c4c7a031fd3776f53c9c43f62116933cea;hp=41ede3c4d32176bd5158870cdf2bae6efb693c3b;hpb=6e3a75969b97a5db4c80c46be49d4deb122abfe7;p=lyx.git diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp index 41ede3c4d3..7d44accf7b 100644 --- a/src/mathed/InsetMathSpace.cpp +++ b/src/mathed/InsetMathSpace.cpp @@ -11,17 +11,14 @@ #include #include "InsetMathSpace.h" -#include "MathArray.h" +#include "MathData.h" #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); }