]> git.lyx.org Git - lyx.git/blobdiff - src/InsetList.cpp
* gcc does not like missing characters in keywords
[lyx.git] / src / InsetList.cpp
index c3d2805511a269bf4b4291e8cebad68d4d9bdf16..5f6398b48c56d5eb62c923f5fa2b1ac314edf0fa 100644 (file)
@@ -147,4 +147,29 @@ InsetList::InsetList(InsetList const & il)
                it->inset = it->inset->clone();
 }
 
+
+pos_type InsetList::find(InsetCode code, pos_type startpos) const
+{
+       List::const_iterator it = insetIterator(startpos);
+       List::const_iterator end = list_.end();
+       for (; it != end ; ++it) {
+               if (it->inset->lyxCode() == code)
+                       return it->pos;
+       }
+       return -1;
+}
+
+
+int InsetList::count(InsetCode code, pos_type startpos) const
+{
+       int num = 0;
+       List::const_iterator it = insetIterator(startpos);
+       List::const_iterator end = list_.end();
+       for (; it != end ; ++it) {
+               if (it->inset->lyxCode() == code)
+                       ++num;
+       }
+       return num;
+}
+
 } // namespace lyx