From 23fded1fc0b243e6afe16797b08cd33ce0997cec Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 1 May 2009 08:17:23 +0000 Subject: [PATCH] New FontList::setMisspelled() method. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29456 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/FontList.cpp | 17 +++++++++++++++++ src/FontList.h | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/src/FontList.cpp b/src/FontList.cpp index afa7894ce9..240ca4d91c 100644 --- a/src/FontList.cpp +++ b/src/FontList.cpp @@ -181,6 +181,23 @@ void FontList::set(pos_type pos, Font const & font) } +void FontList::setMisspelled(pos_type startpos, pos_type endpos, + bool misspelled) +{ + if (list_.empty()) + return; + + List::iterator end_it = fontIterator(endpos); + List::iterator const end = list_.end(); + if (end_it != end) + ++end_it; + + List::iterator cit = fontIterator(startpos); + for (; cit != end_it; ++cit) + cit->font_.setMisspelled(misspelled); +} + + FontSize FontList::highestInRange(pos_type startpos, pos_type endpos, FontSize def_size) const { diff --git a/src/FontList.h b/src/FontList.h index 61ab2205f2..388a04ee21 100644 --- a/src/FontList.h +++ b/src/FontList.h @@ -105,6 +105,12 @@ public: /// void decreasePosAfterPos(pos_type pos); + /// + void setMisspelled( + pos_type startpos, + pos_type endpos, + bool misspelled); + /// Returns the height of the highest font in range FontSize highestInRange( pos_type startpos,