From: Abdelrazak Younes Date: Fri, 1 May 2009 13:45:30 +0000 (+0000) Subject: Fix font issue due to mispelled marking. X-Git-Tag: 2.0.0~6714 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f2197de98ab0c04827cb5c540394189174cc7012;p=features.git Fix font issue due to mispelled marking. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29474 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/FontList.cpp b/src/FontList.cpp index 36b79cec56..923986f11a 100644 --- a/src/FontList.cpp +++ b/src/FontList.cpp @@ -184,12 +184,15 @@ void FontList::set(pos_type pos, Font const & font) void FontList::setMisspelled(pos_type startpos, pos_type endpos, bool misspelled) { - // FIXME: Optimize!!! - for (pos_type pos = startpos; pos != endpos; ++pos) { - Font f = get(pos); - f.setMisspelled(misspelled); - set(pos, f); - } + List::iterator start = fontIterator(startpos); + if (misspelled && start->font().isMisspelled()) + return; + if (!misspelled && !start->font().isMisspelled()) + return; + + Font f = start->font(); + f.setMisspelled(misspelled); + setRange(startpos, endpos, f); }