(forwardInset): speed up (like forwardPar).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15848
a592a061-630c-0410-9148-
cb99ea01b6c8
-#if 0
- DocIterator cmp(*this);
-#endif
-
while (!empty() && (!inTexted() || pos() != 0)) {
if (inTexted()) {
pos_type const lastp = lastpos();
while (!empty() && (!inTexted() || pos() != 0)) {
if (inTexted()) {
pos_type const lastp = lastpos();
-
-#if 0
- while (!cmp.empty() && (!cmp.inTexted() || cmp.pos() != 0))
- cmp.forwardPos();
- BOOST_ASSERT(cmp == *this);
-#endif
void DocIterator::forwardInset()
{
forwardPos();
void DocIterator::forwardInset()
{
forwardPos();
- while (!empty() && (pos() == lastpos() || nextInset() == 0))
+
+ while (!empty() && !nextInset()) {
+ if (inTexted()) {
+ pos_type const lastp = lastpos();
+ Paragraph const & par = paragraph();
+ pos_type & pos = top().pos();
+ while (pos < lastp && !par.isInset(pos))
+ ++pos;
+ if (pos < lastp)
+ break;
+ }