ParIterator & ParIterator::operator++()
{
while (!positions.empty()) {
- ParPosition & p = positions.back();
+ ParPosition & p = positions.top();
// Does the current inset contain more "cells" ?
if (p.index >= 0) {
++p.index;
- Paragraph * par = (*p.it)->getFirstParagraph(p.index);
+ Paragraph * par = p.it.getInset()->getFirstParagraph(p.index);
if (par) {
- positions.push_back(ParPosition(par));
+ positions.push(ParPosition(par));
return *this;
}
++p.it;
// The following line is needed because the value of
// p.it may be invalid if inset was added/removed to
// the paragraph pointed by the iterator
- p.it = p.par->inset_iterator_begin();
+ p.it = p.par->insetlist.begin();
// Try to find the next inset that contains paragraphs
- for ( ; p.it != p.par->inset_iterator_end(); ++p.it) {
- Paragraph * par = (*p.it)->getFirstParagraph(0);
+ InsetList::iterator end = p.par->insetlist.end();
+ for (; p.it != end; ++p.it) {
+ Paragraph * par = p.it.getInset()->getFirstParagraph(0);
if (par) {
p.index = 0;
- positions.push_back(ParPosition(par));
+ positions.push(ParPosition(par));
return *this;
}
}
return *this;
}
- positions.pop_back();
+ positions.pop();
}
return *this;
}