X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_iterator.h;h=d30bd4752998ba59c2d499f5935e6c45515d40d5;hb=cd19a0b33bcc87b46c3567928d85a4c724f49db5;hp=e351080906326e0f94aaa3c00ae2bfd347899d96;hpb=fe31e337c13c4db657a267c7a9cf9869a10db696;p=lyx.git diff --git a/src/mathed/math_iterator.h b/src/mathed/math_iterator.h index e351080906..d30bd47529 100644 --- a/src/mathed/math_iterator.h +++ b/src/mathed/math_iterator.h @@ -1,3 +1,4 @@ +// -*- C++ -*- #ifndef MATH_ITERATOR_H #define MATH_ITERATOR_H @@ -9,36 +10,36 @@ class MathIterator { public: /// default constructor, used for end of range //MathIterator(); - /// start with given formula - explicit MathIterator(MathAtom & t); + /// start with given inset + explicit MathIterator(MathInset * p); /// start with given position - explicit MathIterator(MathCursor::cursor_type const & cursor); + //explicit MathIterator(MathCursor::cursor_type const & cursor); /// MathCursorPos const & operator*() const; /// MathCursorPos const & operator->() const; - /// + /// move on one step void operator++(); - /// read access to top most item - MathCursorPos const & position() const; + /// move on several steps + void jump(MathInset::difference_type); + /// read access to top most item (inline after running gprof!) + MathCursorPos const & position() const { return cursor_.back(); } /// write access to top most item - MathCursorPos & position(); + MathCursorPos & position() { return cursor_.back(); } /// read access to full path MathCursor::cursor_type const & cursor() const; /// read access to top most inset - MathAtom const & par() const; + MathInset const * par() const; /// read access to top most inset - MathAtom & par(); + MathInset * par(); /// helper for iend void goEnd(); - + /// read access to top most item + MathArray const & cell() const; + private: - /// write access to top most item - MathXArray const & xcell() const; - /// write access to top most item - MathAtom * nextInset() const; /// own level down - void push(MathAtom &); + void push(MathInset *); /// own level up void pop(); @@ -52,8 +53,8 @@ bool operator==(MathIterator const &, MathIterator const &); bool operator!=(MathIterator const &, MathIterator const &); /// -MathIterator ibegin(MathAtom & p); +MathIterator ibegin(MathInset * p); /// -MathIterator iend(MathAtom & p); +MathIterator iend(MathInset * p); #endif