]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.C
Make lyx2lyx output the new external inset format.
[lyx.git] / src / buffer.C
index ea8485e06667046a9481b4935a29333757b00a0b..0289a5da5b0be21b6d4ce838b77a2e872c1b2d14 100644 (file)
@@ -680,8 +680,8 @@ bool Buffer::writeFile(string const & fname) const
 
        // this will write out all the paragraphs
        // using recursive descent.
-       ParagraphList::iterator pit = paragraphs.begin();
-       ParagraphList::iterator pend = paragraphs.end();
+       ParagraphList::const_iterator pit = paragraphs.begin();
+       ParagraphList::const_iterator pend = paragraphs.end();
        for (; pit != pend; ++pit)
                pit->write(this, ofs, params, depth);
 
@@ -2253,13 +2253,13 @@ ParIterator Buffer::par_iterator_end()
 
 ParConstIterator Buffer::par_iterator_begin() const
 {
-       return ParConstIterator(paragraphs.begin(), paragraphs);
+       return ParConstIterator(const_cast<ParagraphList&>(paragraphs).begin(), paragraphs);
 }
 
 
 ParConstIterator Buffer::par_iterator_end() const
 {
-       return ParConstIterator(paragraphs.end(), paragraphs);
+       return ParConstIterator(const_cast<ParagraphList&>(paragraphs).end(), paragraphs);
 }
 
 
@@ -2382,7 +2382,7 @@ void Buffer::setParentName(string const & name)
 
 
 Buffer::inset_iterator::inset_iterator()
-       : pit(0), pend(0)
+       : pit(), pend()
 {}
 
 
@@ -2393,6 +2393,32 @@ Buffer::inset_iterator::inset_iterator(base_type p, base_type e)
 }
 
 
+Buffer::inset_iterator Buffer::inset_iterator_begin()
+{
+       return inset_iterator(paragraphs.begin(), paragraphs.end());
+}
+
+
+Buffer::inset_iterator Buffer::inset_iterator_end()
+{
+       return inset_iterator(paragraphs.end(), paragraphs.end());
+}
+
+
+Buffer::inset_iterator Buffer::inset_const_iterator_begin() const
+{
+       return inset_iterator(const_cast<ParagraphList&>(paragraphs).begin(),
+                             const_cast<ParagraphList&>(paragraphs).end());
+}
+
+
+Buffer::inset_iterator Buffer::inset_const_iterator_end() const
+{
+       return inset_iterator(const_cast<ParagraphList&>(paragraphs).end(),
+                             const_cast<ParagraphList&>(paragraphs).end());
+}
+
+
 Buffer::inset_iterator & Buffer::inset_iterator::operator++()
 {
        if (pit != pend) {
@@ -2416,13 +2442,13 @@ Buffer::inset_iterator Buffer::inset_iterator::operator++(int)
 
 Buffer::inset_iterator::reference Buffer::inset_iterator::operator*()
 {
-       return *it.getInset();
+       return *it->inset;
 }
 
 
 Buffer::inset_iterator::pointer Buffer::inset_iterator::operator->()
 {
-       return it.getInset();
+       return it->inset;
 }
 
 
@@ -2434,7 +2460,7 @@ ParagraphList::iterator Buffer::inset_iterator::getPar() const
 
 lyx::pos_type Buffer::inset_iterator::getPos() const
 {
-       return it.getPos();
+       return it->pos;
 }