}
-void DocIterator::forwardPos(bool ignorecollapsed)
+// This duplicates code above, but is in the critical path.
+// So please think twice before adding stuff
+void DocIterator::forwardPos()
{
- //this dog bites his tail
+ // this dog bites his tail
if (empty()) {
push_back(CursorSlice(*inset_));
return;
}
- Inset * const nextinset = nextInset();
- // jump over collapsables if they are collapsed
- // FIXME: the check for asInsetMath() shouldn't be necessary
- // but math insets do not return a sensible editable() state yet.
- if (ignorecollapsed && nextinset && (!nextinset->asInsetMath()
- && nextinset->editable() != Inset::HIGHLY_EDITABLE)) {
- ++top().pos();
- return;
- }
-
CursorSlice & tip = top();
//lyxerr << "XXX\n" << *this << endl;
}
+void DocIterator::forwardPosIgnoreCollapsed()
+{
+ Inset * const nextinset = nextInset();
+ // FIXME: the check for asInsetMath() shouldn't be necessary
+ // but math insets do not return a sensible editable() state yet.
+ if (nextinset && !nextinset->asInsetMath()
+ && nextinset->editable() != Inset::HIGHLY_EDITABLE) {
+ ++top().pos();
+ return;
+ }
+ forwardPos();
+}
+
+
void DocIterator::forwardPar()
{
forwardPos();
//
/**
* move on one logical position, descend into nested insets
- * skip collapsed insets if \p ignorecollapsed is true
+ * including collapsed insets
*/
- void forwardPos(bool ignorecollapsed = false);
+ void forwardPos();
+ /**
+ * move on one logical position, descend into nested insets
+ * skip collapsed insets
+ */
+ void forwardPosIgnoreCollapsed();
/// move on one physical character or inset
void forwardChar();
/// move on one paragraph