diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index d4a1f2e5de..b7bcd1082d 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -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) diff --git a/development/scons/scons_manifest.py b/development/scons/scons_manifest.py index 33b5b977a9..b4ac819582 100644 --- a/development/scons/scons_manifest.py +++ b/development/scons/scons_manifest.py @@ -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 diff --git a/src/ASpell.cpp b/src/ASpellChecker.cpp similarity index 88% rename from src/ASpell.cpp rename to src/ASpellChecker.cpp index b4a8bdb173..6526b3b681 100644 --- a/src/ASpell.cpp +++ b/src/ASpellChecker.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 -#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; diff --git a/src/ASpell_local.h b/src/ASpellChecker.h similarity index 92% rename from src/ASpell_local.h rename to src/ASpellChecker.h index 9f5fed78c8..78d233b238 100644 --- a/src/ASpell_local.h +++ b/src/ASpellChecker.h @@ -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 &); diff --git a/src/HunspellSpellChecker.cpp b/src/HunspellChecker.cpp similarity index 57% rename from src/HunspellSpellChecker.cpp rename to src/HunspellChecker.cpp index 9fb1bd0c94..2310f77458 100644 --- a/src/HunspellSpellChecker.cpp +++ b/src/HunspellChecker.cpp @@ -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 -#include "HunspellSpellChecker.h" +#include "HunspellChecker.h" #include "LyXRC.h" #include "WordLangTuple.h" @@ -31,47 +31,47 @@ namespace { typedef map 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(); } diff --git a/src/HunspellSpellChecker.h b/src/HunspellChecker.h similarity index 82% rename from src/HunspellSpellChecker.h rename to src/HunspellChecker.h index aca9f2dd65..8defa22e41 100644 --- a/src/HunspellSpellChecker.h +++ b/src/HunspellChecker.h @@ -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 &); diff --git a/src/LyX.cpp b/src/LyX.cpp index 8acdb53a78..55cd35ceb5 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -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 diff --git a/src/Makefile.am b/src/Makefile.am index c32ab7fa3c..306d801a79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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