]> git.lyx.org Git - lyx.git/blobdiff - src/iterators.C
"Inter-word Space"
[lyx.git] / src / iterators.C
index 011e44062baaedaf2660e29b5c38ac0082182b2c..0821d0e667f8c2e8e9e042ccacaf6011f929ffb7 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());
        }
 }
@@ -103,7 +103,7 @@ ParIterator & ParIterator::operator++()
                // Does the current inset contain more "cells" ?
                if (p.index) {
                        ++(*p.index);
-                       ParagraphList * plist = p.it->getInset()->getParagraphs(*p.index);
+                       ParagraphList * plist = (*p.it)->inset->getParagraphs(*p.index);
                        if (plist && !plist->empty()) {
                                pimpl_->positions.push(ParPosition(plist->begin(), *plist));
                                return *this;
@@ -118,7 +118,7 @@ ParIterator & ParIterator::operator++()
                // Try to find the next inset that contains paragraphs
                InsetList::iterator end = p.pit->insetlist.end();
                for (; *p.it != end; ++(*p.it)) {
-                       ParagraphList * plist = p.it->getInset()->getParagraphs(0);
+                       ParagraphList * plist = (*p.it)->inset->getParagraphs(0);
                        if (plist && !plist->empty()) {
                                p.index.reset(0);
                                pimpl_->positions.push(ParPosition(plist->begin(), *plist));
@@ -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();
@@ -215,7 +215,7 @@ ParConstIterator & ParConstIterator::operator++()
                // Does the current inset contain more "cells" ?
                if (p.index) {
                        ++(*p.index);
-                       ParagraphList * plist = p.it->getInset()->getParagraphs(*p.index);
+                       ParagraphList * plist = (*p.it)->inset->getParagraphs(*p.index);
                        if (plist && !plist->empty()) {
                                pimpl_->positions.push(ParPosition(plist->begin(), *plist));
                                return *this;
@@ -230,7 +230,7 @@ ParConstIterator & ParConstIterator::operator++()
                // Try to find the next inset that contains paragraphs
                InsetList::iterator end = p.pit->insetlist.end();
                for (; *p.it != end; ++(*p.it)) {
-                       ParagraphList * plist = p.it->getInset()->getParagraphs(0);
+                       ParagraphList * plist = (*p.it)->inset->getParagraphs(0);
                        if (plist && !plist->empty()) {
                                p.index.reset(0);
                                pimpl_->positions.push(ParPosition(plist->begin(), *plist));
@@ -239,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();