5 ParIterator & ParIterator::operator++()
7 while (!positions.empty()) {
8 ParPosition & p = positions.top();
10 // Does the current inset contain more "cells" ?
13 ParagraphList * plist = p.it.getInset()->getParagraphs(p.index);
14 if (plist && !plist->empty()) {
15 positions.push(ParPosition(&plist->front()));
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 ParagraphList * plist = p.it.getInset()->getParagraphs(0);
29 if (plist && !plist->empty()) {
31 positions.push(ParPosition(&plist->front()));
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 ParagraphList * plist = p.it.getInset()->getParagraphs(p.index);
56 if (plist && !plist->empty()) {
57 positions.push(ParPosition(&plist->front()));
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 ParagraphList * plist = p.it.getInset()->getParagraphs(0);
71 if (plist && !plist->empty()) {
73 positions.push(ParPosition(&plist->front()));
77 // Try to go to the next paragarph
79 p = ParPosition(p.par->next());