#pragma implementation
#endif
-#ifdef USE_PSPELL
-
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <ctime>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <ctime>
+# endif
+#endif
+
#ifdef HAVE_SYS_SELECT_H
# ifdef HAVE_STRINGS_H
// <strings.h> is needed at least on AIX because FD_ZERO uses bzero().
#include "LString.h"
#include "support/lstrings.h"
+#include "lyxrc.h"
+#include "debug.h"
+#include "encoding.h"
+#include "sp_ispell.h"
+
+using std::endl;
+
+namespace {
+ /// pid for the `ispell' process.
+ pid_t isp_pid = -1;
+}
+
+/// can be found in src/insets/figinset.C
+extern void sigchldchecker(pid_t pid, int * status);
+
+///
+// ------------------- start special pspell code/class --------------------
+///
+#ifdef USE_PSPELL
+
#include "support/LAssert.h"
#define USE_ORIGINAL_MANAGER_FUNCS 1
#include "sp_pspell.h"
-extern void sigchldchecker(pid_t pid, int *status);
-
PSpell::PSpell()
+ : sc(0), els(0), spell_error_object(0), flag(ISP_UNKNOWN)
{
- els = 0;
- sc = 0;
- spell_error_object = 0;
- flag = ISP_UNKNOWN;
}
PSpell::PSpell(BufferParams const & params, string const & lang)
+ : sc(0), els(0), spell_error_object(0), flag(ISP_UNKNOWN)
{
- els = 0;
- sc = 0;
- spell_error_object = 0;
- flag = ISP_UNKNOWN;
initialize(params, lang);
}
void PSpell::initialize(BufferParams const &, string const & lang)
{
PspellConfig * config = new_pspell_config();
- string code;
- split(lang, code, '_');
- config->replace("language-tag", code.c_str());
+ config->replace("language-tag", lang.c_str());
spell_error_object = new_pspell_manager(config);
if (pspell_error_number(spell_error_object) != 0) {
error_ = pspell_error_message(spell_error_object);
{
if (els)
return pspell_string_emulation_next(els);
+ return "";
}
char const * PSpell::error()
sigchldchecker(pid, status);
}
-
-
-#else
-
-/*
- *This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-1998 The LyX Team
- *
- * ======================================================
- */
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <ctime>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <ctime>
-# endif
-#endif
-
-#ifdef HAVE_SYS_SELECT_H
-# ifdef HAVE_STRINGS_H
- // <strings.h> is needed at least on AIX because FD_ZERO uses bzero().
- // BUT we cannot include both string.h and strings.h on Irix 6.5 :(
-# ifdef _AIX
-# include <strings.h>
-# endif
-# endif
-#include <sys/select.h>
#endif
-#include "LString.h"
-#include "support/lstrings.h"
-#include "lyxrc.h"
-#include "debug.h"
-#include "encoding.h"
-#include "sp_ispell.h"
-
-using std::endl;
-
-/// can be found in src/insets/figinset.C
-extern void sigchldchecker(pid_t pid, int * status);
-
-namespace {
-/// pid for the `ispell' process.
-pid_t isp_pid = -1;
-}
-
+///
+// ------------------- start special ispell code/class --------------------
+///
ISpell::ISpell()
{
{
return error_;
}
-
-
-
-#endif