namespace lyx {
using std::string;
-using std::auto_ptr;
using std::ostream;
}
-bool InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const
{
frontend::FontMetrics const & fm =
theFontMetrics(mi.base.font);
dim.wid = fm.width(ds);
if (kind_ == HYPHENATION && dim.wid > 5)
dim.wid -= 2; // to make it look shorter
- bool const changed = dim_ != dim;
- dim_ = dim;
- return changed;
+
+ setDimCache(mi, dim);
}
}
-auto_ptr<Inset> InsetSpecialChar::doClone() const
+Inset * InsetSpecialChar::clone() const
{
- return auto_ptr<Inset>(new InsetSpecialChar(kind_));
+ return new InsetSpecialChar(kind_);
}
void InsetSpecialChar::validate(LaTeXFeatures & features) const
{
- if (kind_ == MENU_SEPARATOR) {
+ if (kind_ == MENU_SEPARATOR)
features.require("lyxarrow");
- }
}