]> git.lyx.org Git - lyx.git/blobdiff - src/dociterator.C
Change to use preffered calling of Boost.Function
[lyx.git] / src / dociterator.C
index e8f4c0012b49898fa0bd4c88d2c79cca84a9b699..2df577b5f4adfffe1cc6caf21a2fcc57c700a139 100644 (file)
@@ -410,6 +410,17 @@ void DocIterator::backwardPos()
 }
 
 
+bool DocIterator::hasPart(DocIterator const & it) const
+{
+       // it can't be a part if it is larger
+       if (it.size() > size())
+               return false;
+
+       // as inset adresses are the 'last' level
+       return &it.back().inset() == &operator[](it.size() - 1).inset();
+}
+
+
 std::ostream & operator<<(std::ostream & os, DocIterator const & dit)
 {
        for (size_t i = 0, n = dit.size(); i != n; ++i)