X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathDots.cpp;h=6e54907653e4131cbd9d7011c458db55e69c7655;hb=11a6b3c4c7a031fd3776f53c9c43f62116933cea;hp=6673d0483897673a040a044166d5cac2473afc8f;hpb=f497296c30e6da2f97b16da8ad1c9e96feffb16b;p=lyx.git diff --git a/src/mathed/InsetMathDots.cpp b/src/mathed/InsetMathDots.cpp index 6673d04838..6e54907653 100644 --- a/src/mathed/InsetMathDots.cpp +++ b/src/mathed/InsetMathDots.cpp @@ -12,31 +12,29 @@ #include #include "InsetMathDots.h" + #include "MathStream.h" #include "MathSupport.h" #include "MathParser.h" +#include "MetricsInfo.h" #include "frontends/FontMetrics.h" -namespace lyx { - - -using std::string; -using std::auto_ptr; +namespace lyx { InsetMathDots::InsetMathDots(latexkeys const * key) : key_(key) {} -auto_ptr InsetMathDots::doClone() const +Inset * InsetMathDots::clone() const { - return auto_ptr(new InsetMathDots(*this)); + return new InsetMathDots(*this); } -bool InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const +void InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const { dim = theFontMetrics(mi.base.font).dimension('M'); dh_ = 0; @@ -51,22 +49,19 @@ bool InsetMathDots::metrics(MetricsInfo & mi, Dimension & dim) const } else if (key_->name == "ddots") dh_ = dim.asc; - if (dim_ == dim) - return false; - dim_ = dim; - return true; } void InsetMathDots::draw(PainterInfo & pain, int x, int y) const { - mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(), + Dimension const dim = dimension(*pain.base.bv); + mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(), key_->name); if (key_->name == "vdots" || key_->name == "ddots") ++x; if (key_->name != "vdots") --y; - mathed_draw_deco(pain, x + 2, y - dh_, dim_.width() - 2, dim_.ascent(), + mathed_draw_deco(pain, x + 2, y - dh_, dim.width() - 2, dim.ascent(), key_->name); setPosCache(pain, x, y); }