mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
* 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:
parent
6b6cb3fe18
commit
0d626b0008
@ -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})
|
||||
|
||||
list(REMOVE_ITEM lyx_sources
|
||||
${TOP_SRC_DIR}/src/ASpell.cpp
|
||||
${TOP_SRC_DIR}/src/PSpell.cpp
|
||||
${TOP_SRC_DIR}/src/ISpell.cpp
|
||||
${TOP_SRC_DIR}/src/AspellChecker.cpp
|
||||
${TOP_SRC_DIR}/src/HunspellChecker.cpp
|
||||
${TOP_SRC_DIR}/src/Variables.cpp
|
||||
${TOP_SRC_DIR}/src/Section.cpp)
|
||||
|
||||
if (NOT HUNSPELL_FOUND)
|
||||
list(REMOVE_ITEM lyx_sources ${TOP_SRC_DIR}/src/HunspellSpellChecker.cpp)
|
||||
list(REMOVE_ITEM lyx_headers
|
||||
${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()
|
||||
|
||||
if (ASPELL_FOUND)
|
||||
include_directories(${ASPELL_INCLUDE_DIR})
|
||||
list(APPEND lyx_sources ${TOP_SRC_DIR}/src/ASpell.cpp)
|
||||
include_directories(${ASPELL_INCLUDE_DIR})
|
||||
list(APPEND lyx_sources ${TOP_SRC_DIR}/src/AspellChecker.cpp)
|
||||
list(APPEND lyx_headers ${TOP_SRC_DIR}/src/AspellChecker.h)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}
|
||||
@ -45,8 +52,8 @@ lyx_add_msvc_pch(lyx)
|
||||
|
||||
|
||||
if (MERGE_FILES)
|
||||
lyx_const_touched_files(_allinone lyx_sources)
|
||||
set(lyx_sources ${_allinone_files})
|
||||
lyx_const_touched_files(_allinone lyx_sources)
|
||||
set(lyx_sources ${_allinone_files})
|
||||
endif()
|
||||
|
||||
if (LYX_LEAK_DETECTION)
|
||||
|
@ -28,7 +28,7 @@ TOP_extra_files = Split('''
|
||||
|
||||
|
||||
src_header_files = Split('''
|
||||
ASpell_local.h
|
||||
AspellChecker.h
|
||||
Author.h
|
||||
BiblioInfo.h
|
||||
Bidi.h
|
||||
@ -75,7 +75,7 @@ src_header_files = Split('''
|
||||
FuncStatus.h
|
||||
Graph.h
|
||||
HSpace.h
|
||||
HunspellSpellChecker.h
|
||||
HunspellChecker.h
|
||||
IndicesList.h
|
||||
InsetIterator.h
|
||||
InsetList.h
|
||||
@ -249,8 +249,8 @@ src_post_files = Split('''
|
||||
|
||||
|
||||
src_extra_src_files = Split('''
|
||||
ASpell.cpp
|
||||
HunspellSpellChecker.cpp
|
||||
AspellChecker.cpp
|
||||
HunspellChecker.cpp
|
||||
main.cpp
|
||||
Section.cpp
|
||||
Variables.cpp
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* \file ASpell.cpp
|
||||
* \file AspellChecker.cpp
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
#include <aspell.h>
|
||||
|
||||
#include "ASpell_local.h"
|
||||
#include "AspellChecker.h"
|
||||
#include "LyXRC.h"
|
||||
#include "WordLangTuple.h"
|
||||
|
||||
@ -25,12 +25,12 @@ using namespace std;
|
||||
|
||||
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) {
|
||||
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();
|
||||
// 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;
|
||||
|
||||
@ -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());
|
||||
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());
|
||||
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;
|
||||
|
||||
@ -151,7 +151,7 @@ docstring const ASpell::nextMiss()
|
||||
}
|
||||
|
||||
|
||||
docstring const ASpell::error()
|
||||
docstring const AspellChecker::error()
|
||||
{
|
||||
char const * err = 0;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file ASpell_local.h
|
||||
* \file AspellChecker.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -26,11 +26,11 @@ struct AspellConfig;
|
||||
namespace lyx {
|
||||
|
||||
|
||||
class ASpell : public SpellChecker
|
||||
class AspellChecker : public SpellChecker
|
||||
{
|
||||
public:
|
||||
ASpell();
|
||||
~ASpell();
|
||||
AspellChecker();
|
||||
~AspellChecker();
|
||||
|
||||
/// check the given word and return the result
|
||||
enum Result check(WordLangTuple const &);
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* \file HunspellSpellChecker.cpp
|
||||
* \file HunspellChecker.cpp
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "HunspellSpellChecker.h"
|
||||
#include "HunspellChecker.h"
|
||||
|
||||
#include "LyXRC.h"
|
||||
#include "WordLangTuple.h"
|
||||
@ -31,47 +31,47 @@ namespace {
|
||||
typedef map<std::string, Hunspell *> Spellers;
|
||||
}
|
||||
|
||||
class HunspellSpellChecker::Private
|
||||
class HunspellChecker::Private
|
||||
{
|
||||
/// the spellers
|
||||
Spellers spellers_;
|
||||
};
|
||||
|
||||
|
||||
HunspellSpellChecker::HunspellSpellChecker(): d(new Private)
|
||||
HunspellChecker::HunspellChecker(): d(new Private)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
HunspellSpellChecker::~HunspellSpellChecker()
|
||||
HunspellChecker::~HunspellChecker()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
SpellChecker::Result HunspellSpellChecker::check(WordLangTuple const & word)
|
||||
SpellChecker::Result HunspellChecker::check(WordLangTuple const & word)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
docstring const HunspellSpellChecker::error()
|
||||
docstring const HunspellChecker::error()
|
||||
{
|
||||
return docstring();
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
/**
|
||||
* \file HunspellSpellChecker.h
|
||||
* \file HunspellChecker.h
|
||||
* This file is part of LyX, the document processor.
|
||||
* Licence details can be found in the file COPYING.
|
||||
*
|
||||
@ -17,11 +17,11 @@
|
||||
namespace lyx {
|
||||
|
||||
|
||||
class HunspellSpellChecker : public SpellChecker
|
||||
class HunspellChecker : public SpellChecker
|
||||
{
|
||||
public:
|
||||
HunspellSpellChecker();
|
||||
~HunspellSpellChecker();
|
||||
HunspellChecker();
|
||||
~HunspellChecker();
|
||||
|
||||
SpellChecker::Result check(WordLangTuple const &);
|
||||
void insert(WordLangTuple const &);
|
@ -17,7 +17,7 @@
|
||||
|
||||
#include "LyX.h"
|
||||
|
||||
#include "ASpell_local.h"
|
||||
#include "AspellChecker.h"
|
||||
#include "Buffer.h"
|
||||
#include "BufferList.h"
|
||||
#include "CmdDef.h"
|
||||
@ -130,7 +130,7 @@ struct LyX::Impl
|
||||
messages_["GUI"] = Messages();
|
||||
|
||||
#if defined(USE_ASPELL)
|
||||
spell_checker_ = new ASpell();
|
||||
spell_checker_ = new AspellChecker();
|
||||
#else
|
||||
spell_checker_ = 0;
|
||||
#endif
|
||||
|
@ -49,11 +49,11 @@ endif
|
||||
BUILT_SOURCES = $(PCH_FILE)
|
||||
|
||||
if USE_ASPELL
|
||||
ASPELL = ASpell.cpp ASpell_local.h
|
||||
ASPELL = AspellChecker.cpp AspellChecker.h
|
||||
endif
|
||||
|
||||
if USE_HUNSPELL
|
||||
HUNSPELL = HunspellSpellChecker.cpp HunspellSpellChecker.h
|
||||
HUNSPELL = HunspellChecker.cpp HunspellChecker.h
|
||||
endif
|
||||
|
||||
# These four objects are linked as object files as they are not
|
||||
|
Loading…
Reference in New Issue
Block a user