]> git.lyx.org Git - lyx.git/blobdiff - src/buffer.h
The forms resize patch, and small updates
[lyx.git] / src / buffer.h
index 106ed852be78cc4766b5cd32415d1cc3d76460a4..ca1e2692bea41dae2480effdfbd4cc720c7d996e 100644 (file)
@@ -236,7 +236,7 @@ public:
        string const getLatexName(bool no_path = true) const;
 
        /// Change name of buffer. Updates "read-only" flag.
-       void fileName(string const & newfile);
+       void setFileName(string const & newfile);
 
        /// Name of the document's parent
        void setParentName(string const &);
@@ -413,6 +413,13 @@ public:
        ///
        class inset_iterator {
        public:
+               typedef std::input_iterator_tag iterator_category;
+               typedef Inset value_type;
+               typedef ptrdiff_t difference_type;
+               typedef Inset * pointer;
+               typedef Inset & reference;
+               
+               
                ///
                inset_iterator() : par(0) /*, it(0)*/ {}
                //
@@ -423,7 +430,7 @@ public:
                inset_iterator(LyXParagraph * paragraph,
                               LyXParagraph::size_type pos);
                ///
-               inset_iterator & operator++() {
+               inset_iterator & operator++() { // prefix ++
                        if (par) {
                                ++it;
                                if (it == par->inset_iterator_end()) {
@@ -434,11 +441,24 @@ public:
                        return *this;
                }
                ///
-               Inset * operator*() {return *it; }
+               inset_iterator operator++(int) { // postfix ++
+                       inset_iterator tmp(par, it.getPos());
+                       if (par) {
+                               ++it;
+                               if (it == par->inset_iterator_end()) {
+                                       par = par->next;
+                                       SetParagraph();
+                               }
+                       }
+                       return tmp;
+               }
+               ///
+               Inset * operator*() { return *it; }
+               
                ///
                LyXParagraph * getPar() { return par; }
                ///
-               LyXParagraph::size_type getPos() {return it.getPos(); }
+               LyXParagraph::size_type getPos() const { return it.getPos(); }
                ///
                friend
                bool operator==(inset_iterator const & iter1,