Fix some bugs

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21091 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-10-20 21:27:22 +00:00
parent 0755a1c9dc
commit 17321b90ad

View File

@ -80,19 +80,21 @@ void FontList::erase(pos_type pos)
iterator beg = list_.begin(); iterator beg = list_.begin();
if (it != list_.end() && it->pos() == pos if (it != list_.end() && it->pos() == pos
&& (pos == 0 && (pos == 0
|| (it != beg && boost::prior(it)->pos() == pos - 1))) { || (it != list_.begin() && boost::prior(it)->pos() == pos - 1))) {
// If it is a multi-character font // If it is a multi-character font
// entry, we just make it smaller // entry, we just make it smaller
// (see update below), otherwise we // (see update below), otherwise we
// should delete it. // should delete it.
unsigned int const i = it - beg; unsigned int const i = it - list_.begin();
list_.erase(beg + i); list_.erase(it);
it = beg + i; if (i >= list_.size())
return;
it = list_.begin() + i;
if (i > 0 && i < list_.size() && if (i > 0 && i < list_.size() &&
list_[i - 1].font() == list_[i].font()) { list_[i - 1].font() == list_[i].font()) {
list_.erase(beg + i - 1); list_.erase(beg + i - 1);
it = beg + i - 1; it = list_.begin() + i - 1;
} }
} }