bool operator==(ParagraphList::iterator const & i1,
ParagraphList::iterator const & i2)
{
- return &(*const_cast<ParagraphList::iterator&>(i1)) == &(*const_cast<ParagraphList::iterator&>(i2));
+ return &(*const_cast<ParagraphList::iterator&>(i1))
+ == &(*const_cast<ParagraphList::iterator&>(i2));
}
}
-ParagraphList::iterator ParagraphList::begin()
+ParagraphList::iterator ParagraphList::begin()
{
return iterator(parlist);
}
}
+void ParagraphList::push_back(Paragraph * p)
+{
+ if (!parlist) {
+ parlist = p;
+ return;
+ }
+
+ Paragraph * pos = parlist;
+ while (pos->next())
+ pos = pos->next();
+ pos->next(p);
+ p->previous(pos);
+}
+
+
int ParagraphList::size() const
{
// When we switch to a std::container this will be O(1)