]> git.lyx.org Git - lyx.git/blobdiff - src/DocIterator.cpp
* do not ignore "requires" field in MathMacro
[lyx.git] / src / DocIterator.cpp
index 1a478cb3328aca74ad9626aba7c1d97fb485e229..cf84b1b1c7cff0657ec2da7ac22322748e3d347a 100644 (file)
@@ -181,6 +181,22 @@ Paragraph const & DocIterator::paragraph() const
 }
 
 
+Paragraph const & DocIterator::innerParagraph() const
+{
+       BOOST_ASSERT(!empty());
+       // go up until first non-0 text is hit
+       // (innermost text is 0 in mathed)
+       for (int i = depth() - 1; i >= 0; --i)
+               if (slices_[i].text())
+                       return slices_[i].paragraph();
+
+       // This case is in principe not possible. We _must_
+       // be inside a Paragraph.
+       BOOST_ASSERT(false);
+       return paragraph();
+}
+
+
 pit_type DocIterator::lastpit() const
 {
        return inMathed() ? 0 : text()->paragraphs().size() - 1;