]> git.lyx.org Git - features.git/commitdiff
Fix bug 6533: Spell-as-you-type stops checking words when they are already wrong
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 5 Jul 2010 15:15:13 +0000 (15:15 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 5 Jul 2010 15:15:13 +0000 (15:15 +0000)
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

src/FontList.cpp

index 923986f11af7c3899b0fde29966dcdfc751f7517..f8f16c94448bce8ded702dc0ae251dea5995e692 100644 (file)
@@ -184,13 +184,8 @@ void FontList::set(pos_type pos, Font const & font)
 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);
 }