]> git.lyx.org Git - lyx.git/blobdiff - src/aspell.C
hopefully fix tex2lyx linking.
[lyx.git] / src / aspell.C
index 507437c6339e1d1dc6f7b2703977a4db45b05537..f9caa75233a690270ba6c0259b50f89d9f8a69e1 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <config.h>
 
-#ifdef USE_ASPELL
-
 #include "debug.h"
 
 #include <aspell.h>
@@ -24,6 +22,7 @@
 
 using std::string;
 
+namespace lyx {
 
 ASpell::ASpell(BufferParams const &, string const & lang)
        : els(0), spell_error_object(0)
@@ -75,7 +74,7 @@ void ASpell::addSpeller(string const & lang)
 
 ASpell::Result ASpell::check(WordLangTuple const & word)
 {
-       Result res = UNKNOWN;
+       Result res = UNKNOWN_WORD;
 
        Spellers::iterator it = spellers_.find(word.lang_code());
        if (it == spellers_.end()) {
@@ -99,9 +98,9 @@ ASpell::Result ASpell::check(WordLangTuple const & word)
                BOOST_ASSERT(sugs != 0);
                els = aspell_word_list_elements(sugs);
                if (aspell_word_list_empty(sugs))
-                       res = UNKNOWN;
+                       res = UNKNOWN_WORD;
                else
-                       res = MISSED;
+                       res = SUGGESTED_WORDS;
        }
        return res;
 }
@@ -134,15 +133,16 @@ string const ASpell::nextMiss()
 }
 
 
-string const ASpell::error()
+docstring const ASpell::error()
 {
        char const * err = 0;
-
+       
        if (spell_error_object && aspell_error_number(spell_error_object) != 0) {
                err = aspell_error_message(spell_error_object);
        }
 
-       return (err ? err : "");
+       return (err ? from_utf8(err) : docstring());
 }
 
-#endif // USE_ASPELL
+
+} // namespace lyx