From: Stephan Witt Date: Thu, 26 Aug 2010 07:09:25 +0000 (+0000) Subject: Workaround for #6865: smarter FontList::setMisspelled implementation X-Git-Tag: 2.0.0~2751 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b02f2006bed4cdc4d04ea7142834e919956eed51;p=lyx.git Workaround for #6865: smarter FontList::setMisspelled implementation git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35203 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/FontList.cpp b/src/FontList.cpp index f8f16c9444..d4cb66e46e 100644 --- a/src/FontList.cpp +++ b/src/FontList.cpp @@ -184,10 +184,14 @@ void FontList::set(pos_type pos, Font const & font) void FontList::setMisspelled(pos_type startpos, pos_type endpos, bool misspelled) { - // FIXME: optimize! - Font f = fontIterator(startpos)->font(); - f.setMisspelled(misspelled); - setRange(startpos, endpos, f); + // FIXME: move misspelled state out of font!? + for (pos_type p = startpos; p <= endpos; ++p) { + Font f = fontIterator(p)->font(); + if (f.isMisspelled() != misspelled) { + f.setMisspelled(misspelled); + set(p, f); + } + } }