]> git.lyx.org Git - lyx.git/blobdiff - src/TocBackend.cpp
typo
[lyx.git] / src / TocBackend.cpp
index 85a4a8a707ff1c19975071ea41956184b01c1656..8b2015fd0a12cae9aec267bd4536843f293dcb6a 100644 (file)
@@ -106,8 +106,6 @@ Toc & TocBackend::toc(string const & type)
 
 bool TocBackend::updateItem(DocIterator const & dit)
 {
-//     Inset * inset = dit.paragraph().inInset();
-//     inset->addToToc(dit);
        if (dit.paragraph().layout().toclevel == Layout::NOT_IN_TOC)
                return false;
 
@@ -205,6 +203,20 @@ TocIterator Toc::item(DocIterator const & dit) const
 }
 
 
+Toc::iterator Toc::item(int depth, docstring const & str)
+{
+       if (empty())
+               return end();
+       iterator it = begin();
+       iterator itend = end();
+       for (; it != itend; ++it) {
+               if (it->depth() == depth && it->str() == str)
+                       break;
+       }
+       return it;
+}
+
+
 void TocBackend::writePlaintextTocList(string const & type, odocstream & os) const
 {
        TocList::const_iterator cit = tocs_.find(type);