]> git.lyx.org Git - features.git/blobdiff - src/iterators.C
parlist-23-a,diff
[features.git] / src / iterators.C
index b268aaf65c3a715c76849062a0ebadb399e9d909..72d8627044091de1c1c9afbe3e1f56d087a7593e 100644 (file)
@@ -45,7 +45,7 @@ public:
 ParPosition::ParPosition(ParagraphList::iterator p, ParagraphList const & pl)
        : pit(p), plist(&pl)
 {
-       if (p != pl.end()) {
+       if (p != const_cast<ParagraphList&>(pl).end()) {
                it.reset(p->insetlist.begin());
        }
 }
@@ -127,7 +127,7 @@ ParIterator & ParIterator::operator++()
                }
 
                // Try to go to the next paragarph
-               if (next(p.pit) != p.plist->end()
+               if (next(p.pit) != const_cast<ParagraphList*>(p.plist)->end()
                    || pimpl_->positions.size() == 1) {
                        ++p.pit;
                        p.index.reset();
@@ -161,6 +161,12 @@ size_t ParIterator::size() const
 }
 
 
+ParagraphList & ParIterator::plist() const
+{
+       return *const_cast<ParagraphList*>(pimpl_->positions.top().plist);
+}
+
+
 bool operator==(ParIterator const & iter1, ParIterator const & iter2)
 {
        return iter1.pimpl_->positions == iter2.pimpl_->positions;
@@ -233,7 +239,7 @@ ParConstIterator & ParConstIterator::operator++()
                }
 
                // Try to go to the next paragarph
-               if (next(p.pit) != p.plist->end()
+               if (next(p.pit) != const_cast<ParagraphList*>(p.plist)->end()
                    || pimpl_->positions.size() == 1) {
                        ++p.pit;
                        p.index.reset();