]> git.lyx.org Git - lyx.git/blobdiff - src/EnchantChecker.cpp
HTML for stackrel.
[lyx.git] / src / EnchantChecker.cpp
index 2470ec576d1afd6db20c410ce6d012be1f09e9b7..e67f525c3ee643a574371e431b4519b6334aca97 100644 (file)
@@ -69,6 +69,11 @@ EnchantChecker::Private::~Private()
 enchant::Dict * EnchantChecker::Private::addSpeller(string const & lang)
 {
        enchant::Broker * instance = enchant::Broker::instance();
+
+       if (!instance->dict_exists(lang))
+               // FIXME error handling?
+               return 0;
+
        enchant::Dict * dict = instance->request_dict(lang);
 
        if (dict) {
@@ -154,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();