]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_iterator.C
fix #1073
[lyx.git] / src / mathed / math_iterator.C
index 8b70f3d52303d2b861e851e394583e762a00df20..eb73b1a3a38b310e8573728d91f5c815b97e4e3c 100644 (file)
@@ -1,3 +1,4 @@
+
 #include <config.h>
 
 #include "math_iterator.h"
@@ -73,8 +74,8 @@ void MathIterator::goEnd()
 
 void MathIterator::operator++()
 {
-       MathCursorPos   & top = back();
-       MathArray & ar  = top.par_->cell(top.idx_);
+       MathCursorPos & top = back();
+       MathArray     & ar  = top.par_->cell(top.idx_);
 
        // move into the current inset if possible
        // it is impossible for pos() == size()!
@@ -119,6 +120,19 @@ void MathIterator::jump(difference_type i)
 }
 
 
+bool MathIterator::normal() const
+{
+       return back().pos_ < cell().size();
+}
+
+
+void MathIterator::shrink(size_type i)
+{
+       if (i < size())
+               erase(begin() + i, end());
+}
+
+
 bool operator==(MathIterator const & it, MathIterator const & jt)
 {
        return MathIterator::base_type(it) == MathIterator::base_type(jt);