]> git.lyx.org Git - lyx.git/blobdiff - src/HunspellChecker.cpp
Comment
[lyx.git] / src / HunspellChecker.cpp
index 19dc81d5d6de7721471cbdcbde51c12364b7dc11..83bd586dcfc29dd8eb03288a5e44bf584fb532fd 100644 (file)
@@ -70,8 +70,8 @@ struct HunspellChecker::Private
 
        /// the location below system/user directory
        /// there the aff+dic files lookup will happen
-       const string dictDirectory(void) { return "dict"; }
-       const int maxLookupSelector(void) { return 3; }
+       const string dictDirectory(void) const { return "dict"; }
+       int maxLookupSelector(void) const { return 3; }
 };
 
 
@@ -207,18 +207,18 @@ HunspellChecker::~HunspellChecker()
 SpellChecker::Result HunspellChecker::check(WordLangTuple const & wl)
 {
        if (d->isIgnored(wl))
-               return OK;
+               return WORD_OK;
 
        Hunspell * h = d->speller(wl.lang()->code());
        if (!h)
-               return OK;
+               return WORD_OK;
        int info;
 
        string const encoding = h->get_dic_encoding();
        string const word_to_check = to_iconv_encoding(wl.word(), encoding);
        
        if (h->spell(word_to_check.c_str(), &info))
-               return OK;
+               return WORD_OK;
 
        if (info & SPELL_COMPOUND) {
                // FIXME: What to do with that?
@@ -233,6 +233,12 @@ SpellChecker::Result HunspellChecker::check(WordLangTuple const & wl)
 }
 
 
+void HunspellChecker::advanceChangeNumber()
+{
+       nextChangeNumber();
+}
+
+
 void HunspellChecker::insert(WordLangTuple const & wl)
 {
        string const word_to_check = to_utf8(wl.word());
@@ -240,12 +246,14 @@ void HunspellChecker::insert(WordLangTuple const & wl)
        if (!h)
                return;
        h->add(word_to_check.c_str());
+       advanceChangeNumber();
 }
 
 
 void HunspellChecker::accept(WordLangTuple const & wl)
 {
        d->ignored_.push_back(wl);
+       advanceChangeNumber();
 }