using std::string;
using std::max;
-using std::auto_ptr;
using std::ostream;
}
-bool InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
{
frontend::FontMetrics const & fm =
theFontMetrics(mi.base.font);
dim.wid = 10;
break;
}
- bool const changed = dim_ != dim;
- dim_ = dim;
- return changed;
+ // Cache the inset dimension.
+ setDimCache(mi, dim);
}
void InsetSpace::draw(PainterInfo & pi, int x, int y) const
{
- int const w = width();
+ Dimension const dim = dimension(*pi.base.bv);
+ int const w = dim.wid;
int const h = theFontMetrics(pi.base.font)
.ascent('x');
int xp[4], yp[4];
}
-auto_ptr<Inset> InsetSpace::doClone() const
+Inset * InsetSpace::clone() const
{
- return auto_ptr<Inset>(new InsetSpace(kind_));
+ return new InsetSpace(kind_);
}