]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_iterator.C
small up/down tweaking
[lyx.git] / src / mathed / math_iterator.C
index 087c5f27d565db4ee38ef5978b9eaaad4db73580..d804fd0fe6debd862a54f0ec0e85e3101543bd14 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
 #include <config.h>
 
 #include "math_iterator.h"
@@ -73,8 +77,8 @@ void MathIterator::goEnd()
 
 void MathIterator::operator++()
 {
-       MathCursorPos   & top = back();
-       MathArray const & 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 +123,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);