]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphList.h
Fix bug #12772
[lyx.git] / src / ParagraphList.h
index a57deb4eea7b2a7e8582ef7cdedeb1deb62176f0..7e5cc1a869ff50b54150f09d1c85d2448731ba9c 100644 (file)
@@ -29,6 +29,17 @@ public:
        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