]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_iterator.C
architectural changes to tex2lyx
[lyx.git] / src / mathed / math_iterator.C
index d804fd0fe6debd862a54f0ec0e85e3101543bd14..0ee78e844e46f0d528f7bcd94d601cff4110bf59 100644 (file)
@@ -1,7 +1,3 @@
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include <config.h>
 
 #include "math_iterator.h"
@@ -9,6 +5,7 @@
 #include "debug.h"
 #include "support/LAssert.h"
 
+using namespace lyx::support;
 
 MathIterator::MathIterator()
 {}
@@ -20,22 +17,22 @@ MathIterator::MathIterator(MathInset * p)
 }
 
 
-MathInset const * MathIterator::par() const
+MathInset const * MathIterator::inset() const
 {
-       return back().par_;
+       return back().inset_;
 }
 
 
-MathInset * MathIterator::par()
+MathInset * MathIterator::inset()
 {
-       return back().par_;
+       return back().inset_;
 }
 
 
 MathArray const & MathIterator::cell() const
 {
-       MathCursorPos const & top = back();
-       return top.par_->cell(top.idx_);
+       CursorPos const & top = back();
+       return top.inset_->cell(top.idx_);
 }
 
 
@@ -43,25 +40,25 @@ MathArray const & MathIterator::cell() const
 void MathIterator::push(MathInset * p)
 {
        //lyxerr << "push: " << p << endl;
-       push_back(MathCursorPos(p));
+       push_back(CursorPos(p));
 }
 
 
 void MathIterator::pop()
 {
        //lyxerr << "pop: " << endl;
-       lyx::Assert(size());
+       Assert(size());
        pop_back();
 }
 
 
-MathCursorPos const & MathIterator::operator*() const
+CursorPos const & MathIterator::operator*() const
 {
        return back();
 }
 
 
-MathCursorPos const & MathIterator::operator->() const
+CursorPos const & MathIterator::operator->() const
 {
        return back();
 }
@@ -69,16 +66,16 @@ MathCursorPos const & MathIterator::operator->() const
 
 void MathIterator::goEnd()
 {
-       MathCursorPos & top = back();
-       top.idx_ = top.par_->nargs() - 1;
+       CursorPos & top = back();
+       top.idx_ = top.inset_->nargs() - 1;
        top.pos_ = cell().size();
 }
 
 
 void MathIterator::operator++()
 {
-       MathCursorPos & top = back();
-       MathArray     & ar  = top.par_->cell(top.idx_);
+       CursorPos & top = back();
+       MathArray     & ar  = top.inset_->cell(top.idx_);
 
        // move into the current inset if possible
        // it is impossible for pos() == size()!
@@ -98,10 +95,10 @@ void MathIterator::operator++()
        }
 
        // otherwise try to move on one cell if possible
-       while (top.idx_ + 1 < top.par_->nargs()) {
+       while (top.idx_ + 1 < top.inset_->nargs()) {
                // idx() == nargs() is _not_ valid!
                ++top.idx_;
-               if (top.par_->validCell(top.idx_)) {
+               if (top.inset_->validCell(top.idx_)) {
                        top.pos_ = 0;
                        return;
                }
@@ -118,8 +115,8 @@ void MathIterator::operator++()
 void MathIterator::jump(difference_type i)
 {
        back().pos_ += i;
-       //lyx::Assert(back().pos_ >= 0);
-       lyx::Assert(back().pos_ <= cell().size());
+       //Assert(back().pos_ >= 0);
+       Assert(back().pos_ <= cell().size());
 }