]> git.lyx.org Git - lyx.git/blobdiff - src/dociterator.C
fix reading the author field.
[lyx.git] / src / dociterator.C
index f0bf8da06988cc805d8bcf79d0810ca8fa7b6aea..2df577b5f4adfffe1cc6caf21a2fcc57c700a139 100644 (file)
@@ -3,8 +3,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author unknown
- * \author Lars Gullik Bjønnes
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -411,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)