]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathBox.cpp
last commit was incomplete... not sure how I managed this..
[lyx.git] / src / mathed / InsetMathBox.cpp
index 0447e84467cb921ac0eaef4ba74f2ec038f43cc5..36c1c163506fbda5defb4a6e9f34c8500572380a 100644 (file)
 
 namespace lyx {
 
-using std::string;
-using std::auto_ptr;
-
-
 InsetMathBox::InsetMathBox(docstring const & name)
        : InsetMathNest(1), name_(name)
 {}
 
 
-auto_ptr<InsetBase> InsetMathBox::doClone() const
+Inset * InsetMathBox::clone() const
 {
-       return auto_ptr<InsetBase>(new InsetMathBox(*this));
+       return new InsetMathBox(*this);
 }
 
 
@@ -48,15 +44,13 @@ void InsetMathBox::normalize(NormalStream & os) const
 }
 
 
-bool InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const
+void InsetMathBox::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        FontSetChanger dummy(mi.base, "textnormal");
        cell(0).metrics(mi, dim);
        metricsMarkers(dim);
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
 }