]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphList.h
Update Win installer for new dictionary links. Untested.
[lyx.git] / src / ParagraphList.h
index cc81e9df64d808023f9ba55fa4e3cd0819d21183..7e5cc1a869ff50b54150f09d1c85d2448731ba9c 100644 (file)
 
 namespace lyx {
 
-/// Container for all kind of Paragraphs used in Lyx.
-typedef RandomAccessList<Paragraph> ParagraphList;
-
+/// 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;
+       }
+};
 
 } // namespace lyx