diff --git a/src/ChangeLog b/src/ChangeLog index 22133ef3d9..bc996cc118 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-06-02 John Levon + + * buffer.h: + * buffer.C: fix inset_iterator.end(), move out of line + (bug 1149) + 2003-06-01 John Levon * text3.C: use a proper cut/paste when doing inset diff --git a/src/buffer.C b/src/buffer.C index 2200f0dc84..e530479d85 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -2394,6 +2394,32 @@ Buffer::inset_iterator::inset_iterator(base_type p, base_type e) } +Buffer::inset_iterator Buffer::inset_iterator_begin() +{ + return inset_iterator(paragraphs.begin(), paragraphs.end()); +} + + +Buffer::inset_iterator Buffer::inset_iterator_end() +{ + return inset_iterator(paragraphs.end(), paragraphs.end()); +} + + +Buffer::inset_iterator Buffer::inset_const_iterator_begin() const +{ + return inset_iterator(const_cast(paragraphs).begin(), + const_cast(paragraphs).end()); +} + + +Buffer::inset_iterator Buffer::inset_const_iterator_end() const +{ + return inset_iterator(const_cast(paragraphs).end(), + const_cast(paragraphs).end()); +} + + Buffer::inset_iterator & Buffer::inset_iterator::operator++() { if (pit != pend) { diff --git a/src/buffer.h b/src/buffer.h index 02de0cb72b..09c2b5670c 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -386,25 +386,17 @@ public: InsetList::iterator it; }; - /// - inset_iterator inset_iterator_begin() { - return inset_iterator(paragraphs.begin(), paragraphs.end()); - } + /// return an iterator to all *top-level* insets in the buffer + inset_iterator inset_iterator_begin(); - /// - inset_iterator inset_iterator_end() { - return inset_iterator(); - } + /// return the end of all *top-level* insets in the buffer + inset_iterator inset_iterator_end(); - /// - inset_iterator inset_const_iterator_begin() const { - return inset_iterator(const_cast(paragraphs).begin(), const_cast(paragraphs).end()); - } + /// return a const iterator to all *top-level* insets in the buffer + inset_iterator inset_const_iterator_begin() const; - /// - inset_iterator inset_const_iterator_end() const { - return inset_iterator(); - } + /// return the const end of all *top-level* insets in the buffer + inset_iterator inset_const_iterator_end() const; /// ParIterator par_iterator_begin();