]> git.lyx.org Git - lyx.git/blobdiff - src/EnchantChecker.cpp
Next step in fixing problems noted by Vincent: Remove magic boolean from
[lyx.git] / src / EnchantChecker.cpp
index 61becbcec86ef3b8e26378f2df493d75d72fa256..3f3b138f58a0d36a7f27f36758b4b4ca515832e8 100644 (file)
@@ -34,7 +34,7 @@ struct Speller {
        enchant::Dict * speller;
 };
 
-typedef std::map<std::string, Speller> Spellers;
+typedef map<string, Speller> Spellers;
   
 } // anon namespace
 
@@ -115,7 +115,7 @@ SpellChecker::Result EnchantChecker::check(WordLangTuple const & word)
        if (!m)
                return OK;
 
-       std::string utf8word(to_utf8(word.word()));
+       string utf8word = to_utf8(word.word());
 
        if (m->check(utf8word))
                return OK;
@@ -159,6 +159,15 @@ void EnchantChecker::suggest(WordLangTuple const & wl,
 }
 
 
+bool EnchantChecker::hasDictionary(Language const * lang) const
+{
+       if (!lang)
+               return false;
+       enchant::Broker * instance = enchant::Broker::instance();
+       return (instance->dict_exists(lang->code()));
+}
+
+
 docstring const EnchantChecker::error()
 {
        return docstring();