]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_decorationinset.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_decorationinset.C
index 5f37628eb54cded008b3182365f89115fcd40740..51de586808b082a38d53710922a815757bef5acd 100644 (file)
@@ -8,15 +8,17 @@
 #include "math_streamstr.h"
 #include "support/LOstream.h"
 
+using std::auto_ptr;
+
 
 MathDecorationInset::MathDecorationInset(latexkeys const * key)
        : MathNestInset(1), key_(key)
 {}
 
 
-MathInset * MathDecorationInset::clone() const
+auto_ptr<InsetBase> MathDecorationInset::clone() const
 {
-       return new MathDecorationInset(*this);
+       return auto_ptr<InsetBase>(new MathDecorationInset(*this));
 }
 
 
@@ -97,7 +99,7 @@ void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const
 {
        cell(0).draw(pi, x + 1, y);
        if (wide())
-               mathed_draw_deco(pi, x + 1, y + dy_, pi.width, dh_, key_->name);
+               mathed_draw_deco(pi, x + 1, y + dy_, cell(0).width(), dh_, key_->name);
        else
                mathed_draw_deco(pi, x + 1 + (pi.width - dw_) / 2,
                        y + dy_, dw_, dh_, key_->name);