* Rename HunspellSpellChecker to HunspellChecker and ASpell to AspellChecker for consistency.

* Cleanup a bit associated CMakefile 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30813 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2009-08-01 17:24:13 +00:00
parent 6b6cb3fe18
commit 0d626b0008
8 changed files with 52 additions and 45 deletions

View File

@ -23,19 +23,26 @@ file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES})
file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES}) file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES})
list(REMOVE_ITEM lyx_sources list(REMOVE_ITEM lyx_sources
${TOP_SRC_DIR}/src/ASpell.cpp ${TOP_SRC_DIR}/src/AspellChecker.cpp
${TOP_SRC_DIR}/src/PSpell.cpp ${TOP_SRC_DIR}/src/HunspellChecker.cpp
${TOP_SRC_DIR}/src/ISpell.cpp
${TOP_SRC_DIR}/src/Variables.cpp ${TOP_SRC_DIR}/src/Variables.cpp
${TOP_SRC_DIR}/src/Section.cpp) ${TOP_SRC_DIR}/src/Section.cpp)
if (NOT HUNSPELL_FOUND) list(REMOVE_ITEM lyx_headers
list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/HunspellSpellChecker.cpp) ${TOP_SRC_DIR}/src/AspellChecker.h
${TOP_SRC_DIR}/src/HunspellChecker.h
${TOP_SRC_DIR}/src/Variables.h
${TOP_SRC_DIR}/src/Section.h)
if (HUNSPELL_FOUND)
list(APPEND lyx_sources ${TOP_SRC_DIR}/src/HunspellChecker.cpp)
list(APPEND lyx_headers ${TOP_SRC_DIR}/src/HunspellChecker.h)
endif() endif()
if (ASPELL_FOUND) if (ASPELL_FOUND)
include_directories(${ASPELL_INCLUDE_DIR}) include_directories(${ASPELL_INCLUDE_DIR})
list(APPEND lyx_sources ${TOP_SRC_DIR}/src/ASpell.cpp) list(APPEND lyx_sources ${TOP_SRC_DIR}/src/AspellChecker.cpp)
list(APPEND lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
endif() endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR} include_directories(${CMAKE_CURRENT_BINARY_DIR}
@ -45,8 +52,8 @@ lyx_add_msvc_pch(lyx)
if (MERGE_FILES) if (MERGE_FILES)
lyx_const_touched_files(_allinone lyx_sources) lyx_const_touched_files(_allinone lyx_sources)
set(lyx_sources ${_allinone_files}) set(lyx_sources ${_allinone_files})
endif() endif()
if (LYX_LEAK_DETECTION) if (LYX_LEAK_DETECTION)

View File

@ -28,7 +28,7 @@ TOP_extra_files = Split('''
src_header_files = Split(''' src_header_files = Split('''
ASpell_local.h AspellChecker.h
Author.h Author.h
BiblioInfo.h BiblioInfo.h
Bidi.h Bidi.h
@ -75,7 +75,7 @@ src_header_files = Split('''
FuncStatus.h FuncStatus.h
Graph.h Graph.h
HSpace.h HSpace.h
HunspellSpellChecker.h HunspellChecker.h
IndicesList.h IndicesList.h
InsetIterator.h InsetIterator.h
InsetList.h InsetList.h
@ -249,8 +249,8 @@ src_post_files = Split('''
src_extra_src_files = Split(''' src_extra_src_files = Split('''
ASpell.cpp AspellChecker.cpp
HunspellSpellChecker.cpp HunspellChecker.cpp
main.cpp main.cpp
Section.cpp Section.cpp
Variables.cpp Variables.cpp

View File

@ -1,5 +1,5 @@
/** /**
* \file ASpell.cpp * \file AspellChecker.cpp
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -15,7 +15,7 @@
#include <aspell.h> #include <aspell.h>
#include "ASpell_local.h" #include "AspellChecker.h"
#include "LyXRC.h" #include "LyXRC.h"
#include "WordLangTuple.h" #include "WordLangTuple.h"
@ -25,12 +25,12 @@ using namespace std;
namespace lyx { namespace lyx {
ASpell::ASpell(): els(0), spell_error_object(0) AspellChecker::AspellChecker(): els(0), spell_error_object(0)
{ {
} }
ASpell::~ASpell() AspellChecker::~AspellChecker()
{ {
if (spell_error_object) { if (spell_error_object) {
delete_aspell_can_have_error(spell_error_object); delete_aspell_can_have_error(spell_error_object);
@ -51,7 +51,7 @@ ASpell::~ASpell()
} }
void ASpell::addSpeller(string const & lang) void AspellChecker::addSpeller(string const & lang)
{ {
AspellConfig * config = new_aspell_config(); AspellConfig * config = new_aspell_config();
// FIXME The aspell documentation says to use "lang" // FIXME The aspell documentation says to use "lang"
@ -86,7 +86,7 @@ void ASpell::addSpeller(string const & lang)
} }
ASpell::Result ASpell::check(WordLangTuple const & word) AspellChecker::Result AspellChecker::check(WordLangTuple const & word)
{ {
Result res = UNKNOWN_WORD; Result res = UNKNOWN_WORD;
@ -124,7 +124,7 @@ ASpell::Result ASpell::check(WordLangTuple const & word)
} }
void ASpell::insert(WordLangTuple const & word) void AspellChecker::insert(WordLangTuple const & word)
{ {
Spellers::iterator it = spellers_.find(word.lang_code()); Spellers::iterator it = spellers_.find(word.lang_code());
if (it != spellers_.end()) if (it != spellers_.end())
@ -132,7 +132,7 @@ void ASpell::insert(WordLangTuple const & word)
} }
void ASpell::accept(WordLangTuple const & word) void AspellChecker::accept(WordLangTuple const & word)
{ {
Spellers::iterator it = spellers_.find(word.lang_code()); Spellers::iterator it = spellers_.find(word.lang_code());
if (it != spellers_.end()) if (it != spellers_.end())
@ -140,7 +140,7 @@ void ASpell::accept(WordLangTuple const & word)
} }
docstring const ASpell::nextMiss() docstring const AspellChecker::nextMiss()
{ {
char const * str = 0; char const * str = 0;
@ -151,7 +151,7 @@ docstring const ASpell::nextMiss()
} }
docstring const ASpell::error() docstring const AspellChecker::error()
{ {
char const * err = 0; char const * err = 0;

View File

@ -1,6 +1,6 @@
// -*- C++ -*- // -*- C++ -*-
/** /**
* \file ASpell_local.h * \file AspellChecker.h
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -26,11 +26,11 @@ struct AspellConfig;
namespace lyx { namespace lyx {
class ASpell : public SpellChecker class AspellChecker : public SpellChecker
{ {
public: public:
ASpell(); AspellChecker();
~ASpell(); ~AspellChecker();
/// check the given word and return the result /// check the given word and return the result
enum Result check(WordLangTuple const &); enum Result check(WordLangTuple const &);

View File

@ -1,5 +1,5 @@
/** /**
* \file HunspellSpellChecker.cpp * \file HunspellChecker.cpp
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -10,7 +10,7 @@
#include <config.h> #include <config.h>
#include "HunspellSpellChecker.h" #include "HunspellChecker.h"
#include "LyXRC.h" #include "LyXRC.h"
#include "WordLangTuple.h" #include "WordLangTuple.h"
@ -31,47 +31,47 @@ namespace {
typedef map<std::string, Hunspell *> Spellers; typedef map<std::string, Hunspell *> Spellers;
} }
class HunspellSpellChecker::Private class HunspellChecker::Private
{ {
/// the spellers /// the spellers
Spellers spellers_; Spellers spellers_;
}; };
HunspellSpellChecker::HunspellSpellChecker(): d(new Private) HunspellChecker::HunspellChecker(): d(new Private)
{ {
} }
HunspellSpellChecker::~HunspellSpellChecker() HunspellChecker::~HunspellChecker()
{ {
delete d; delete d;
} }
SpellChecker::Result HunspellSpellChecker::check(WordLangTuple const & word) SpellChecker::Result HunspellChecker::check(WordLangTuple const & word)
{ {
return OK; return OK;
} }
void HunspellSpellChecker::insert(WordLangTuple const & word) void HunspellChecker::insert(WordLangTuple const & word)
{ {
} }
void HunspellSpellChecker::accept(WordLangTuple const & word) void HunspellChecker::accept(WordLangTuple const & word)
{ {
} }
docstring const HunspellSpellChecker::nextMiss() docstring const HunspellChecker::nextMiss()
{ {
return docstring(); return docstring();
} }
docstring const HunspellSpellChecker::error() docstring const HunspellChecker::error()
{ {
return docstring(); return docstring();
} }

View File

@ -1,6 +1,6 @@
// -*- C++ -*- // -*- C++ -*-
/** /**
* \file HunspellSpellChecker.h * \file HunspellChecker.h
* This file is part of LyX, the document processor. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* *
@ -17,11 +17,11 @@
namespace lyx { namespace lyx {
class HunspellSpellChecker : public SpellChecker class HunspellChecker : public SpellChecker
{ {
public: public:
HunspellSpellChecker(); HunspellChecker();
~HunspellSpellChecker(); ~HunspellChecker();
SpellChecker::Result check(WordLangTuple const &); SpellChecker::Result check(WordLangTuple const &);
void insert(WordLangTuple const &); void insert(WordLangTuple const &);

View File

@ -17,7 +17,7 @@
#include "LyX.h" #include "LyX.h"
#include "ASpell_local.h" #include "AspellChecker.h"
#include "Buffer.h" #include "Buffer.h"
#include "BufferList.h" #include "BufferList.h"
#include "CmdDef.h" #include "CmdDef.h"
@ -130,7 +130,7 @@ struct LyX::Impl
messages_["GUI"] = Messages(); messages_["GUI"] = Messages();
#if defined(USE_ASPELL) #if defined(USE_ASPELL)
spell_checker_ = new ASpell(); spell_checker_ = new AspellChecker();
#else #else
spell_checker_ = 0; spell_checker_ = 0;
#endif #endif

View File

@ -49,11 +49,11 @@ endif
BUILT_SOURCES = $(PCH_FILE) BUILT_SOURCES = $(PCH_FILE)
if USE_ASPELL if USE_ASPELL
ASPELL = ASpell.cpp ASpell_local.h ASPELL = AspellChecker.cpp AspellChecker.h
endif endif
if USE_HUNSPELL if USE_HUNSPELL
HUNSPELL = HunspellSpellChecker.cpp HunspellSpellChecker.h HUNSPELL = HunspellChecker.cpp HunspellChecker.h
endif endif
# These four objects are linked as object files as they are not # These four objects are linked as object files as they are not