]> git.lyx.org Git - features.git/blobdiff - src/ParagraphList.h
parlist-22-a.diff
[features.git] / src / ParagraphList.h
index 9f049bf895c952075fe3776bb9e1b1abe1b84191..649106e757117e2ccce30659669c064ec3464dad 100644 (file)
@@ -3,17 +3,30 @@
 #ifndef PARAGRAPH_LIST_H
 #define PARAGRAPH_LIST_H
 
-#include <iterator>
-#include <utility>
+#define NO_STD_LIST 1
+
+#ifndef NO_STD_LIST
+
+#include "paragraph.h"
+
+#include <list>
+
+typedef std::list<Paragraph> ParagraphList;
+
+#else
 
 class Paragraph;
 
+#include <iterator>
+#include <utility>
+
 ///
 class ParagraphList {
 public:
        ///
        class iterator {
        public:
+               friend class ParagraphList;
                ///
                typedef std::bidirectional_iterator_tag iterator_category;
                ///
@@ -27,8 +40,6 @@ public:
                ///
                iterator();
                ///
-               iterator(value_type);
-               ///
                reference operator*();
                ///
                pointer operator->();
@@ -41,6 +52,8 @@ public:
                ///
                iterator operator--(int);
        private:
+               ///
+               iterator(value_type);
                ///
                Paragraph * ptr;
        };
@@ -51,7 +64,7 @@ public:
        ///
        ParagraphList & operator=(ParagraphList const &);
        ///
-       iterator insert(iterator it, Paragraph * par);
+       iterator insert(iterator it, Paragraph const & par);
        ///
        void insert(iterator pos, iterator beg, iterator end);
        ///
@@ -73,9 +86,7 @@ public:
        ///
        iterator end() const;
        ///
-       void set(Paragraph *);
-       ///
-       void push_back(Paragraph *);
+       void push_back(Paragraph const &);
        ///
        Paragraph const & front() const;
        ///
@@ -106,5 +117,6 @@ bool operator==(ParagraphList::iterator const & i1,
 bool operator!=(ParagraphList::iterator const & i1,
                ParagraphList::iterator const & i2);
 
+#endif
 
 #endif