X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraphList.h;h=7e5cc1a869ff50b54150f09d1c85d2448731ba9c;hb=4ed0312c51704780af1c452d3a82a84171b3725a;hp=a57deb4eea7b2a7e8582ef7cdedeb1deb62176f0;hpb=345d7c00cd85576102a025daad82e6537fcb12d2;p=lyx.git diff --git a/src/ParagraphList.h b/src/ParagraphList.h index a57deb4eea..7e5cc1a869 100644 --- a/src/ParagraphList.h +++ b/src/ParagraphList.h @@ -29,6 +29,17 @@ public: ParagraphList(InputIterator first, InputIterator last) : RandomAccessList(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