]> git.lyx.org Git - lyx.git/commitdiff
allow to use new pspell
authorJohn Levon <levon@movementarian.org>
Tue, 6 Aug 2002 02:37:41 +0000 (02:37 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 6 Aug 2002 02:37:41 +0000 (02:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4871 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/pspell.C

index 08cd890d4c4b4b0eef50e221494f305066e34abf..11c3ddb2951f706cb56ce991cfba716902f453ff 100644 (file)
@@ -1,3 +1,7 @@
+2002-08-06  John Levon  <levon@movementarian.org>
+
+       * pspell.C: fix a crash, and allow new aspell to work
 2002-08-06  John Levon  <levon@movementarian.org>
 
        * lyxfunc.C:
index ea6e0371e0e0e823a8ac489e5d25c25d60ba6255..9c850d62c7393489ffa3828f9350817c78401fa9 100644 (file)
 #include "support/LAssert.h"
 
 #define USE_ORIGINAL_MANAGER_FUNCS 1
+// new aspell pspell missing extern "C" 
+extern "C" { 
 #include <pspell/pspell.h>
+}
 
 #include "pspell.h"
 
+using std::endl;
 
-PSpell::PSpell(BufferParams const & params, string const & lang)
+PSpell::PSpell(BufferParams const &, string const & lang)
        : sc(0), els(0), spell_error_object(0), alive_(false)
 {
        PspellConfig * config = new_pspell_config();
-       config->replace("language-tag", lang.c_str());
+       pspell_config_replace(config, "lang", lang.c_str());
        spell_error_object = new_pspell_manager(config);
        if (pspell_error_number(spell_error_object) == 0) {
                sc = to_pspell_manager(spell_error_object);
                spell_error_object = 0;
                alive_ = true;
+       } else {
+               lyxerr << pspell_error_message(spell_error_object) << endl;
        }
 }
 
@@ -118,7 +124,7 @@ string const PSpell::error()
 {
        char const * err = 0;
  
-       if (pspell_error_number(spell_error_object) != 0) {
+       if (spell_error_object && pspell_error_number(spell_error_object) != 0) {
                err = pspell_error_message(spell_error_object);
        }