]> git.lyx.org Git - lyx.git/blobdiff - src/Session.cpp
FindAdv: Search for 'whole words' with help of modified regex.
[lyx.git] / src / Session.cpp
index cfb256538aae9163e24c8a398f95b64897fea317..16b6df7c61b2a3bca93cce9fb73dc85a256f3eba 100644 (file)
@@ -325,7 +325,7 @@ bool BookmarksSection::isValid(unsigned int i) const
 
 bool BookmarksSection::hasValid() const
 {
-       for (size_t i = 1; i <size(); ++i) {
+       for (size_t i = 1; i < bookmarks.size(); ++i) {
                if (isValid(i))
                        return true;
        }
@@ -339,6 +339,20 @@ 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;
+}
+
+
 LastCommandsSection::LastCommandsSection(unsigned int num) :
        default_num_last_commands(30),
        absolute_max_last_commands(100)