]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/array.C
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / array.C
index 3a663915d0684910b532239b27415154866966dc..a15ec82dedc3a38db7b14c4cb9c65aeb5c1070e8 100644 (file)
@@ -20,7 +20,7 @@ MathArray::MathArray()
 MathArray::~MathArray()
 {
        for (int pos = 0; pos < size(); next(pos)) 
-               if (MathIsInset(pos)) 
+               if (isInset(pos)) 
                        delete nextInset(pos);
 }
 
@@ -33,6 +33,14 @@ MathArray::MathArray(MathArray const & array)
                        replace(pos, nextInset(pos)->clone());
 }
 
+MathArray::MathArray(MathArray const & array, int from, int to)
+       : bf_(array.bf_.begin() + from, array.bf_.begin() + to)
+{
+       for (int pos = 0; pos < size(); next(pos)) 
+               if (isInset(pos)) 
+                       replace(pos, nextInset(pos)->clone());
+}
+
 
 bool MathArray::next(int & pos) const
 {
@@ -209,6 +217,12 @@ int MathArray::size() const
 }
 
 
+void MathArray::erase()
+{
+       erase(0, size());
+}
+
+
 void MathArray::erase(int pos)
 {
        if (pos < static_cast<int>(bf_.size()))
@@ -226,7 +240,7 @@ bool MathArray::isInset(int pos) const
 {
        if (pos >= size())
                return false;
-       return MathIsInset(bf_[pos]);
+       return MathIsInset(static_cast<MathTextCodes>(bf_[pos]));
 }