]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphList.h
Update Win installer for new dictionary links. Untested.
[lyx.git] / src / ParagraphList.h
index b1e9d6d2869e6eb7eb2a1ea567697b3d366a7f1c..7e5cc1a869ff50b54150f09d1c85d2448731ba9c 100644 (file)
@@ -1,16 +1,47 @@
 // -*- C++ -*-
+/**
+ * \file ParagraphList.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
 #ifndef PARAGRAPH_LIST_H
 #define PARAGRAPH_LIST_H
 
-#include "paragraph.h"
+#include "Paragraph.h"
 
-#include <list>
+#include "support/RandomAccessList.h"
 
-struct ParagraphList : public std::list<Paragraph>
-{
+
+namespace lyx {
+
+/// Container for all kind of Paragraphs used in LyX.
+class ParagraphList : public RandomAccessList<Paragraph> {
+public:
+       ///
+       ParagraphList() {}
+       ///
+       template<class InputIterator>
+       ParagraphList(InputIterator first, InputIterator last)
+               : RandomAccessList<Paragraph>(first, last)
+       {}
+
+       const Paragraph * getParagraphBefore(const_iterator const & par) const
+       {
+               // No previous paragraph.
+               if (par == begin())
+                       return nullptr;
+
+               auto prevpar = par;
+               --prevpar;
+               return &*prevpar;
+       }
 };
 
-typedef std::pair<ParagraphList::iterator, int> PitPosPair;
+} // namespace lyx
 
 #endif