]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_arrayinset.C
Fix math cursor positioning bug
[lyx.git] / src / mathed / math_arrayinset.C
index c153ef0869c1aacf4efa12473dc954e51426e7a7..6cbcd3a093861535da7b5fa21b47d54f4bdb7f33 100644 (file)
 
 #include <config.h>
 
+#include "LaTeXFeatures.h"
 #include "math_arrayinset.h"
 #include "math_data.h"
 #include "math_parser.h"
 #include "math_mathmlstream.h"
 #include "math_streamstr.h"
-#include "support/std_sstream.h"
 
 #include <iterator>
+#include <sstream>
 
 using std::getline;
 
+using std::string;
 using std::auto_ptr;
 using std::istringstream;
 using std::istream_iterator;
@@ -68,7 +70,7 @@ MathArrayInset::MathArrayInset(string const & name, string const & str)
 }
 
 
-auto_ptr<InsetBase> MathArrayInset::clone() const
+auto_ptr<InsetBase> MathArrayInset::doClone() const
 {
        return auto_ptr<InsetBase>(new MathArrayInset(*this));
 }
@@ -77,17 +79,15 @@ auto_ptr<InsetBase> MathArrayInset::clone() const
 void MathArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        ArrayChanger dummy(mi.base);
-       MathGridInset::metrics(mi);
-       metricsMarkers2();
-       dim = dim_;
+       MathGridInset::metrics(mi, dim);
 }
 
 
 void MathArrayInset::draw(PainterInfo & pi, int x, int y) const
 {
+       setPosCache(pi, x, y);
        ArrayChanger dummy(pi.base);
        MathGridInset::draw(pi, x + 1, y);
-       drawMarkers2(pi, x, y);
 }
 
 
@@ -131,3 +131,11 @@ void MathArrayInset::maple(MapleStream & os) const
        MathGridInset::maple(os);
        os << ')';
 }
+
+
+void MathArrayInset::validate(LaTeXFeatures & features) const
+{
+       if (name_ == "subarray")
+               features.require("amsmath");
+       MathGridInset::validate(features);
+}