]> git.lyx.org Git - lyx.git/blobdiff - src/TocBackend.cpp
Typos.
[lyx.git] / src / TocBackend.cpp
index 6ce5f4044bef194c450b62631464e963d7c51679..8b2015fd0a12cae9aec267bd4536843f293dcb6a 100644 (file)
@@ -149,6 +149,7 @@ bool TocBackend::updateItem(DocIterator const & dit)
 
        const_cast<TocItem &>(*toc_item).str_ = tocstring;
 
+       buffer_->updateTocItem("tableofcontents", dit);
        return true;
 }
 
@@ -202,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);