From: John Levon Date: Tue, 6 Aug 2002 02:37:41 +0000 (+0000) Subject: allow to use new pspell X-Git-Tag: 1.6.10~18670 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=e5d2dc5dcd0cd3d95f32e1dbb1d2f0dce4ebb24a;p=lyx.git allow to use new pspell git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4871 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 08cd890d4c..11c3ddb295 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2002-08-06 John Levon + + * pspell.C: fix a crash, and allow new aspell to work + 2002-08-06 John Levon * lyxfunc.C: diff --git a/src/pspell.C b/src/pspell.C index ea6e0371e0..9c850d62c7 100644 --- a/src/pspell.C +++ b/src/pspell.C @@ -18,21 +18,27 @@ #include "support/LAssert.h" #define USE_ORIGINAL_MANAGER_FUNCS 1 +// new aspell pspell missing extern "C" +extern "C" { #include +} #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); }