5 ParIterator & ParIterator::operator++()
7 while (!positions.empty()) {
8 ParPosition & p = positions.back();
10 // Does the current inset contain more "cells" ?
13 Paragraph * par = (*p.it)->getFirstParagraph(p.index);
15 positions.push_back(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 for ( ; p.it != p.par->inset_iterator_end(); ++p.it) {
27 Paragraph * par = (*p.it)->getFirstParagraph(0);
30 positions.push_back(ParPosition(par));
34 // Try to go to the next paragarph
36 p = ParPosition(p.par->next());