]> git.lyx.org Git - lyx.git/blobdiff - src/ASpell.cpp
add onoff support for "inset-modify changetype xxx" in include inset
[lyx.git] / src / ASpell.cpp
index 0cef57293d15ebdde8266c42b20a91423f01b226..b4a8bdb173f5536313c7f82332646a9846de0229 100644 (file)
 #include "LyXRC.h"
 #include "WordLangTuple.h"
 
-#include <boost/assert.hpp>
+#include "support/lassert.h"
 
 using namespace std;
 
 namespace lyx {
 
-ASpell::ASpell(BufferParams const &, string const & lang)
-       : els(0), spell_error_object(0)
+ASpell::ASpell(): els(0), spell_error_object(0)
 {
-       addSpeller(lang);
 }
 
 
@@ -66,7 +64,7 @@ void ASpell::addSpeller(string const & lang)
        // platforms (cygwin, OS X). Therefore we use utf-8, that does
        // always work.
        aspell_config_replace(config, "encoding", "utf-8");
-       if (lyxrc.isp_accept_compound)
+       if (lyxrc.spellchecker_accept_compound)
                // Consider run-together words as legal compounds
                aspell_config_replace(config, "run-together", "true");
        else
@@ -103,15 +101,19 @@ ASpell::Result ASpell::check(WordLangTuple const & word)
 
        AspellSpeller * m = it->second.speller;
 
+       if (word.word().empty())
+               // MSVC compiled Aspell doesn't like it.
+               return OK;
+
        int const word_ok = aspell_speller_check(m, to_utf8(word.word()).c_str(), -1);
-       BOOST_ASSERT(word_ok != -1);
+       LASSERT(word_ok != -1, /**/);
 
        if (word_ok)
                return OK;
 
        AspellWordList const * sugs =
                aspell_speller_suggest(m, to_utf8(word.word()).c_str(), -1);
-       BOOST_ASSERT(sugs != 0);
+       LASSERT(sugs != 0, /**/);
        els = aspell_word_list_elements(sugs);
        if (aspell_word_list_empty(sugs))
                res = UNKNOWN_WORD;