X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FSession.cpp;h=a814991e59dcbdfdb709931f881c313f1dad3672;hb=b08a653f3549e08fffc5318c87da305651ecc197;hp=f8d611644ca94a523dff11eadd26d418cea77114;hpb=b64b1aa85e18a57878c96f697317340b7db1a169;p=lyx.git diff --git a/src/Session.cpp b/src/Session.cpp index f8d611644c..a814991e59 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -339,6 +339,29 @@ BookmarksSection::Bookmark const & BookmarksSection::bookmark(unsigned int i) co } +BookmarksSection::BookmarkPosList +BookmarksSection::bookmarksInPar(FileName const & fn, int const par_id) const +{ + // FIXME: we do not consider the case of bottom_pit. + // This is probably not a problem. + BookmarksSection::BookmarkPosList bip; + for (size_t i = 1; i < bookmarks.size(); ++i) + if (bookmarks[i].filename == fn && bookmarks[i].top_id == par_id) + bip.push_back({i, bookmarks[i].top_pos}); + + return bip; +} + + +void BookmarksSection::adjustPosAfterPos(FileName const & fn, + int const par_id, pos_type pos, int offset) +{ + for (Bookmark & bkm : bookmarks) + if (bkm.filename == fn && bkm.top_id == par_id && bkm.top_pos > pos) + bkm.top_pos += offset; +} + + LastCommandsSection::LastCommandsSection(unsigned int num) : default_num_last_commands(30), absolute_max_last_commands(100)