]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_makeboxinset.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_makeboxinset.C
index c2b6264da389aa0580c982c2cea175865f376d9a..b708d4a7da40987dcf0eda45aa0b05778a0e7758 100644 (file)
@@ -10,6 +10,7 @@
 #include "math_streamstr.h"
 #include "frontends/Painter.h"
 
+using std::auto_ptr;
 
 
 MathMakeboxInset::MathMakeboxInset()
@@ -17,29 +18,30 @@ MathMakeboxInset::MathMakeboxInset()
 {}
 
 
-MathInset * MathMakeboxInset::clone() const
+auto_ptr<InsetBase> MathMakeboxInset::clone() const
 {
-       return new MathMakeboxInset(*this);
+       return auto_ptr<InsetBase>(new MathMakeboxInset(*this));
 }
 
 
-void MathMakeboxInset::metrics(MetricsInfo & mi) const
+void MathMakeboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        FontSetChanger dummy(mi.base, "textnormal");
        w_ = mathed_char_width(mi.base.font, '[');
        MathNestInset::metrics(mi);
-       dim_    = cell(0).dim();
-       dim_   += cell(1).dim();
-       dim_   += cell(2).dim();
+       dim_   = cell(0).dim();
+       dim_  += cell(1).dim();
+       dim_  += cell(2).dim();
        dim_.wid += 4 * w_ + 4;
-       metricsMarkers2();
+       metricsMarkers();
+       dim = dim_;
 }
 
 
 void MathMakeboxInset::draw(PainterInfo & pi, int x, int y) const
 {
        FontSetChanger dummy(pi.base, "textnormal");
-       drawMarkers2(pi, x, y);
+       drawMarkers(pi, x, y);
 
        drawStrBlack(pi, x, y, "[");
        x += w_;