]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_decorationinset.C
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_decorationinset.C
index 2d404421c85f4c71979670d866c55a2b3b71af44..eddbbf7ce17b4654616df51d1a079ecd04692254 100644 (file)
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-#include "LaTeXFeatures.h"
 #include "math_decorationinset.h"
 #include "math_data.h"
 #include "math_support.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
 
+#include "LaTeXFeatures.h"
 #include "debug.h"
 
 #include "support/std_ostream.h"
 
-using std::auto_ptr;
-
 
 MathDecorationInset::MathDecorationInset(latexkeys const * key)
        : MathNestInset(1), key_(key)
@@ -33,9 +31,9 @@ MathDecorationInset::MathDecorationInset(latexkeys const * key)
 }
 
 
-auto_ptr<InsetBase> MathDecorationInset::doClone() const
+std::auto_ptr<InsetBase> MathDecorationInset::doClone() const
 {
-       return auto_ptr<InsetBase>(new MathDecorationInset(*this));
+       return std::auto_ptr<InsetBase>(new MathDecorationInset(*this));
 }
 
 
@@ -93,7 +91,7 @@ bool MathDecorationInset::wide() const
 
 bool MathDecorationInset::ams() const
 {
-       return  
+       return
                        key_->name == "overleftrightarrow" ||
                        key_->name == "underleftarrow" ||
                        key_->name == "underrightarrow" ||
@@ -130,13 +128,7 @@ void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const
                mathed_draw_deco(pi, x + 1 + (cell(0).width() - dw_) / 2,
                        y + dy_, dw_, dh_, key_->name);
        drawMarkers(pi, x, y);
-}
-
-
-void MathDecorationInset::validate(LaTeXFeatures & features) const
-{
-       if (ams())
-               features.require("amsmath");
+       setPosCache(pi, x, y);
 }
 
 
@@ -158,3 +150,11 @@ void MathDecorationInset::infoize(std::ostream & os) const
 {
        os << "Deco: " << key_->name;
 }
+
+
+void MathDecorationInset::validate(LaTeXFeatures & features) const
+{
+       if (ams())
+               features.require("amsmath");
+       MathNestInset::validate(features);
+}