]> git.lyx.org Git - lyx.git/blobdiff - src/pariterator.C
add config.h
[lyx.git] / src / pariterator.C
index 8d6fe920564c616ec9b0541b7f71194d77dc1359..90a3a82b2f12bf232878d1a2e7da94eb02aaf3ff 100644 (file)
 
 #include "pariterator.h"
 
-#include "ParagraphList_fwd.h"
 #include "paragraph.h"
 #include "lyxtext.h"
 
 #include "insets/inset.h"
 
-using lyx::par_type;
 
+namespace lyx {
 
 ///
 /// ParIterator
@@ -53,6 +52,18 @@ ParIterator & ParIterator::operator++()
 }
 
 
+ParIterator ParIterator::operator++(int)
+{
+       ParIterator tmp(*this);
+       forwardPar();
+       return tmp;
+}
+
+
+#if 0
+// Unused member functions. Also having this makes ParIterator not be
+// an forward iterator anymore. So unless we change that, this function
+// should not be compiled/used. (Lgb)
 ParIterator & ParIterator::operator--()
 {
 #ifdef WITH_WARNINGS
@@ -61,35 +72,36 @@ ParIterator & ParIterator::operator--()
 //     DocIterator::backwardPar();
        return *this;
 }
+#endif
 
 
 Paragraph & ParIterator::operator*() const
 {
-       return text()->getPar(par());
+       return const_cast<Paragraph&>(text()->getPar(pit()));
 }
 
 
-par_type ParIterator::pit() const
+pit_type ParIterator::pit() const
 {
-       return par();
+       return DocIterator::pit();
 }
 
 
 Paragraph * ParIterator::operator->() const
 {
-       return &text()->getPar(par());
+       return const_cast<Paragraph*>(&text()->getPar(pit()));
 }
 
 
-par_type ParIterator::outerPar() const
+pit_type ParIterator::outerPar() const
 {
-       return bottom().par();
+       return bottom().pit();
 }
 
 
 ParagraphList & ParIterator::plist() const
 {
-       return text()->paragraphs();
+       return const_cast<ParagraphList&>(text()->paragraphs());
 }
 
 
@@ -105,7 +117,7 @@ bool operator!=(ParIterator const & iter1, ParIterator const & iter2)
 }
 
 
-DocIterator makeDocIterator(ParIterator const & par, lyx::pos_type pos)
+DocIterator makeDocIterator(ParIterator const & par, pos_type pos)
 {
        DocIterator dit(par);
        dit.pos() = pos;
@@ -138,13 +150,13 @@ ParConstIterator & ParConstIterator::operator++()
 
 Paragraph const & ParConstIterator::operator*() const
 {
-       return text()->getPar(par());
+       return text()->getPar(pit());
 }
 
 
 Paragraph const * ParConstIterator::operator->() const
 {
-       return &text()->getPar(par());
+       return &text()->getPar(pit());
 }
 
 
@@ -180,3 +192,6 @@ ParConstIterator par_const_iterator_end(InsetBase const & inset)
 {
        return ParConstIterator(doc_iterator_end(const_cast<InsetBase &>(inset)));
 }
+
+
+} // namespace lyx