5 ParIterator & ParIterator::operator++()
7 while (!positions.empty()) {
8 ParPosition & p = positions.top();
10 // Does the current inset contain more "cells" ?
13 Paragraph * par = (*p.it)->getFirstParagraph(p.index);
15 positions.push(ParPosition(par));
20 // The following line is needed because the value of
21 // p.it may be invalid if inset was added/removed to
22 // the paragraph pointed by the iterator
23 p.it = p.par->inset_iterator_begin();
25 // Try to find the next inset that contains paragraphs
26 Paragraph::inset_iterator end = p.par->inset_iterator_end();
27 for (; p.it != end; ++p.it) {
28 Paragraph * par = (*p.it)->getFirstParagraph(0);
31 positions.push(ParPosition(par));
35 // Try to go to the next paragarph
37 p = ParPosition(p.par->next());