]> git.lyx.org Git - lyx.git/blobdiff - src/iterators.C
Point fix, earlier forgotten
[lyx.git] / src / iterators.C
index 5865272ff1c020977787b2558d28ed7d1639bce8..920c66ab7c586bbbfdec67b3d7e55329002827a1 100644 (file)
@@ -5,7 +5,7 @@
  * \author unknown
  * \author Lars Gullik Bjønnes
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 
@@ -47,7 +47,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());
        }
 }
@@ -129,7 +129,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();
@@ -253,7 +253,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();
@@ -288,6 +288,12 @@ ParagraphList::const_iterator ParConstIterator::operator->() const
 }
 
 
+ParagraphList const & ParConstIterator::plist() const
+{
+       return *pimpl_->positions.back().plist;
+}
+
+
 size_t ParConstIterator::size() const
 {
        return pimpl_->positions.size();