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.getInset()->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->insetlist.begin();
25 // Try to find the next inset that contains paragraphs
26 InsetList::iterator end = p.par->insetlist.end();
27 for (; p.it != end; ++p.it) {
28 Paragraph * par = p.it.getInset()->getFirstParagraph(0);
31 positions.push(ParPosition(par));
35 // Try to go to the next paragarph
37 p = ParPosition(p.par->next());
47 ParConstIterator & ParConstIterator::operator++()
49 while (!positions.empty()) {
50 ParPosition & p = positions.top();
52 // Does the current inset contain more "cells" ?
55 Paragraph * par = p.it.getInset()->getFirstParagraph(p.index);
57 positions.push(ParPosition(par));
62 // The following line is needed because the value of
63 // p.it may be invalid if inset was added/removed to
64 // the paragraph pointed by the iterator
65 p.it = p.par->insetlist.begin();
67 // Try to find the next inset that contains paragraphs
68 InsetList::iterator end = p.par->insetlist.end();
69 for (; p.it != end; ++p.it) {
70 Paragraph * par = p.it.getInset()->getFirstParagraph(0);
73 positions.push(ParPosition(par));
77 // Try to go to the next paragarph
79 p = ParPosition(p.par->next());