The problem was in FontList::setMisspelled, where an optimization looked at the first character of the word in order to return early when the misspelled flag is already correct. This does not work when the first letters of the word have this flag but not the last one.
If this optimization was really useful, it can be reimplemented properly in terms of font spans.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34765
a592a061-630c-0410-9148-
cb99ea01b6c8
void FontList::setMisspelled(pos_type startpos, pos_type endpos,
bool misspelled)
{
- List::iterator start = fontIterator(startpos);
- if (misspelled && start->font().isMisspelled())
- return;
- if (!misspelled && !start->font().isMisspelled())
- return;
-
- Font f = start->font();
+ // FIXME: optimize!
+ Font f = fontIterator(startpos)->font();
f.setMisspelled(misspelled);
setRange(startpos, endpos, f);
}