]> git.lyx.org Git - lyx.git/blobdiff - src/dociterator.C
* remove various xforms relicts, in particular:
[lyx.git] / src / dociterator.C
index 0b3e0567ec476da5f79e0194247707858ceccd6b..2e314e012f60708c06b95c607dcea98575a870a8 100644 (file)
@@ -289,7 +289,7 @@ InsetBase * DocIterator::innerInsetOfType(int code) const
 }
 
 
-void DocIterator::forwardPos()
+void DocIterator::forwardPos(bool ignorecollapsed)
 {
        //this dog bites his tail
        if (empty()) {
@@ -297,6 +297,15 @@ void DocIterator::forwardPos()
                return;
        }
 
+       // jump over collapsables if they are collapsed
+       // FIXME: the check for asMathInset() shouldn't be necessary
+       // but math insets do not return a sensible editable() state yet.
+       if (ignorecollapsed && nextInset() && (!nextInset()->asMathInset()
+           && nextInset()->editable() != InsetBase::HIGHLY_EDITABLE)) {
+               ++top().pos();
+               return;
+       }
+
        CursorSlice & tip = top();
        //lyxerr << "XXX\n" << *this << endl;
 
@@ -503,7 +512,7 @@ bool DocIterator::hasPart(DocIterator const & it) const
 }
 
 
-void DocIterator::updateInsets(InsetBase * inset) 
+void DocIterator::updateInsets(InsetBase * inset)
 {
        // this function re-creates the cache of inset pointers.
        // code taken in part from StableDocIterator::asDocIterator.
@@ -578,4 +587,3 @@ bool operator==(StableDocIterator const & dit1, StableDocIterator const & dit2)
 {
        return dit1.data_ == dit2.data_;
 }
-