]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathDelim.cpp
fix off-by-two drawing error
[lyx.git] / src / mathed / InsetMathDelim.cpp
index 3580ed683e9e6da94e3c8e97e28cdd695119c0c4..9a1ca07f864bc1dd2bdb6f43074475ab668581ae 100644 (file)
 #include "MathSupport.h"
 #include "MetricsInfo.h"
 
+#include "support/docstring.h"
+
 #include "frontends/FontMetrics.h"
 
+using namespace std;
 
 namespace lyx {
 
@@ -56,6 +59,7 @@ Inset * InsetMathDelim::clone() const
 
 void InsetMathDelim::write(WriteStream & os) const
 {
+       MathEnsurer ensurer(os);
        os << "\\left" << convertDelimToLatexName(left_) << cell(0)
           << "\\right" << convertDelimToLatexName(right_);
 }
@@ -70,7 +74,6 @@ void InsetMathDelim::normalize(NormalStream & os) const
 
 void InsetMathDelim::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       using std::max;
        Dimension dim0;
        cell(0).metrics(mi, dim0);
        Dimension t = theFontMetrics(mi.base.font).dimension('I');
@@ -85,8 +88,6 @@ void InsetMathDelim::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.wid = dim0.width() + 2 * dw_ + 8;
        dim.asc = max(a0, d0) + h0;
        dim.des = max(a0, d0) - h0;
-       // Cache the inset dimension. 
-       setDimCache(mi, dim);
 }