BufferList::next() and previous(): don't cycle through 'internal' buffers.

This should fix bug http://bugzilla.lyx.org/show_bug.cgi?id=5259


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26495 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-09-22 09:59:46 +00:00
parent c0aeb567ce
commit 36f619ed25

View File

@ -168,10 +168,10 @@ Buffer * BufferList::next(Buffer const * buf) const
bstore.end(), buf); bstore.end(), buf);
LASSERT(it != bstore.end(), /**/); LASSERT(it != bstore.end(), /**/);
++it; ++it;
if (it == bstore.end()) Buffer * nextbuf = (it == bstore.end()) ? bstore.front() : *it;
return bstore.front(); if (nextbuf->fileName().extension() == "internal")
else return next(nextbuf);
return *it; return nextbuf;
} }
@ -184,10 +184,11 @@ Buffer * BufferList::previous(Buffer const * buf) const
BufferStorage::const_iterator it = find(bstore.begin(), BufferStorage::const_iterator it = find(bstore.begin(),
bstore.end(), buf); bstore.end(), buf);
LASSERT(it != bstore.end(), /**/); LASSERT(it != bstore.end(), /**/);
if (it == bstore.begin())
return bstore.back(); Buffer * previousbuf = (it == bstore.begin()) ? bstore.back() : *(it - 1);
else if (previousbuf->fileName().extension() == "internal")
return *(it - 1); return previous(previousbuf);
return previousbuf;
} }