]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/CommandInset.cpp
* InsetMathHull:
[lyx.git] / src / mathed / CommandInset.cpp
index 67b56f506e688f2b707242250ccdb0cfbc145dd3..7c24458cf557dbab919f6d65ca3ed087de53193b 100644 (file)
 
 #include <sstream>
 
+using namespace std;
 
 namespace lyx {
 
-using std::string;
 
 CommandInset::CommandInset(docstring const & name)
        : InsetMathNest(2), name_(name), set_label_(false)
@@ -36,17 +36,15 @@ Inset * CommandInset::clone() const
 }
 
 
-bool CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
+void CommandInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        if (!set_label_) {
                set_label_ = true;
                button_.update(screenLabel(), true);
        }
        button_.metrics(mi, dim);
-       if (dim_ == dim)
-               return false;
-       dim_ = dim;
-       return true;
+       // Cache the inset dimension. 
+       setDimCache(mi, dim);
 }