]> git.lyx.org Git - features.git/commitdiff
Rename some of the elements of the SpellBase::Result enum.
authorAngus Leeming <leeming@lyx.org>
Thu, 20 Jan 2005 16:17:37 +0000 (16:17 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 20 Jan 2005 16:17:37 +0000 (16:17 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9513 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/SpellBase.h
src/aspell.C
src/aspell_local.h
src/buffer.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlSpellchecker.C
src/ispell.C
src/ispell.h
src/pspell.C
src/pspell.h

index 591580f75b1db8dcb2a537e393109aa9c46d0201..73b407350e241a47c1b6d9d4273fcfc8f613d47d 100644 (file)
@@ -1,5 +1,18 @@
+2005-01-20  Angus Leeming  <leeming@lyx.org>
+
+       * SpellBase.h: rename some of the elements of the Result enum.
+
+       * aspell_local.h:
+       * ispell.h:
+       * pspell.h:
+       * aspell.C (check):
+       * ispell.C (check):
+       * pspell.C (check): ditto
+
 2005-01-20  Asger Ottar Alstrup  <aalstrup@laerdal.dk>
 
+       * buffer.C: add #include <fstream>.
+
        * lyx_main.C (init): Compile fix.
 
        * lyxserver.[Ch] (inPipeName, outPipeName): move out of line.
index dbdf6b742068f7f7b4962c4e3d5eee5701fe0f8a..7850cd1517599ddbcf5934cf2d1249c180ce21ed 100644 (file)
@@ -26,12 +26,18 @@ public:
 
        /// the result from checking a single word
        enum Result  {
-               OK = 1, //< word is correct
-               ROOT, //< root of given word was found
-               COMPOUNDWORD, //< word found through compound formation
-               UNKNOWN, //< word not found
-               MISSED, //< not found, with suggestions
-               IGNORE //< number of other ignored "word"
+               /// word is correct
+               OK = 1,
+               /// root of given word was found
+               ROOT,
+               /// word found through compound formation
+               COMPOUND_WORD,
+               /// word not found
+               UNKNOWN_WORD,
+               /// not found, with suggestions
+               SUGGESTED_WORDS,
+               /// number of other ignored "word"
+               IGNORED_WORD
        };
 
        virtual ~SpellBase() {}
@@ -48,7 +54,7 @@ public:
        /// accept the given word temporarily
        virtual void accept(WordLangTuple const &) = 0;
 
-       /// return the next near miss after a MISSED result
+       /// return the next near miss after a SUGGESTED_WORDS result
        virtual std::string const nextMiss() = 0;
 
        /// give an error message on messy exit
index 507437c6339e1d1dc6f7b2703977a4db45b05537..84fb21036994a8b56b3f955f0f790abbcd2ec97d 100644 (file)
@@ -75,7 +75,7 @@ void ASpell::addSpeller(string const & lang)
 
 ASpell::Result ASpell::check(WordLangTuple const & word)
 {
-       Result res = UNKNOWN;
+       Result res = UNKNOWN_WORD;
 
        Spellers::iterator it = spellers_.find(word.lang_code());
        if (it == spellers_.end()) {
@@ -99,9 +99,9 @@ ASpell::Result ASpell::check(WordLangTuple const & word)
                BOOST_ASSERT(sugs != 0);
                els = aspell_word_list_elements(sugs);
                if (aspell_word_list_empty(sugs))
-                       res = UNKNOWN;
+                       res = UNKNOWN_WORD;
                else
-                       res = MISSED;
+                       res = SUGGESTED_WORDS;
        }
        return res;
 }
index 8d72099705add5176d1c1fdc4fb67e70cae02e33..59d67294c45c2245aced95278f75750b276bda91 100644 (file)
@@ -49,7 +49,7 @@ public:
        /// accept the given word temporarily
        virtual void accept(WordLangTuple const &);
 
-       /// return the next near miss after a MISSED result
+       /// return the next near miss after a SUGGESTED_WORDS result
        virtual std::string const nextMiss();
 
        /// give an error message on messy exit
index 4a7de29cb7d8a012bf1c50b53017dc4cda2ce57a..d93d9ac832b3ace9bcb2a5f5f64ccc1eb296f6bc 100644 (file)
@@ -79,6 +79,7 @@
 #include <iomanip>
 #include <stack>
 #include <sstream>
+#include <fstream>
 
 
 using lyx::pos_type;
index 5babff8eb73f61521c2b1aa44cb6c847fef758ab..6be78120d8f5574366dd5d7d13127b60c9f53b68 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-20  Angus Leeming  <leeming@lyx.org>
+
+       * ControlSpellchecker.C (check): s/IGNORE/IGNORED_WORD/.
+
 2005-01-17  Angus Leeming  <leeming@lyx.org>
 
        * tex_helpers.C (rescanTexStyles): prepend the name of the
index 2ca46452592307835801792646ccd5438b6ff2d3..40a73dba5dad205b26c5e366119abd481c231884 100644 (file)
@@ -195,7 +195,7 @@ void ControlSpellchecker::check()
 
        BufferParams & bufferparams = kernel().buffer().params();
 
-       while (res == SpellBase::OK || res == SpellBase::IGNORE) {
+       while (res == SpellBase::OK || res == SpellBase::IGNORED_WORD) {
                word_ = nextWord(cur, start, bufferparams);
 
                // end of document
@@ -237,7 +237,7 @@ void ControlSpellchecker::check()
        kernel().bufferview()->update();
 
        // set suggestions
-       if (res != SpellBase::OK && res != SpellBase::IGNORE) {
+       if (res != SpellBase::OK && res != SpellBase::IGNORED_WORD) {
                lyxerr[Debug::GUI] << "Found a word needing checking." << endl;
                dialog().view().partialUpdate(SPELL_FOUND_WORD);
        }
index 6a2aac96b497963bcf9fbe71ee6630f8ee906baa..c14e5da106d763bb97aa73205449e4f75199cdc0 100644 (file)
@@ -373,18 +373,18 @@ enum ISpell::Result ISpell::check(WordLangTuple const & word)
 
        if (error) {
                error_ = _("Could not communicate with the spell-checker program.");
-               return UNKNOWN;
+               return UNKNOWN_WORD;
        }
 
        if (err_read) {
                error_ = buf;
-               return UNKNOWN;
+               return UNKNOWN_WORD;
        }
 
        // I think we have to check if ispell is still alive here because
        // the signal-handler could have disabled blocking on the fd
        if (!alive())
-               return UNKNOWN;
+               return UNKNOWN_WORD;
 
        switch (*buf) {
        case '*':
@@ -394,18 +394,18 @@ enum ISpell::Result ISpell::check(WordLangTuple const & word)
                res = ROOT;
                break;
        case '-':
-               res = COMPOUNDWORD;
+               res = COMPOUND_WORD;
                break;
        case '\n':
-               res = IGNORE;
+               res = IGNORED_WORD;
                break;
        case '#': // Not found, no near misses and guesses
-               res = UNKNOWN;
+               res = UNKNOWN_WORD;
                break;
        case '?': // Not found, and no near misses, but guesses (guesses are ignored)
        case '&': // Not found, but we have near misses
        {
-               res = MISSED;
+               res = SUGGESTED_WORDS;
                char * p = strpbrk(buf, ":");
                str = new char[strlen(p) + 1];
                e   = str;
@@ -413,11 +413,11 @@ enum ISpell::Result ISpell::check(WordLangTuple const & word)
                break;
        }
        default: // This shouldn't happen, but you know Murphy
-               res = UNKNOWN;
+               res = UNKNOWN_WORD;
        }
 
        *buf = 0;
-       if (res != IGNORE) {
+       if (res != IGNORED_WORD) {
                /* wait for ispell to finish */
                while (*buf!= '\n')
                        fgets(buf, 255, in);
index ae14e337d4916b988380f6814d114919e49956c2..e33d848cb7ee915587db37705882c6fc294d5228 100644 (file)
@@ -45,7 +45,7 @@ public:
        /// accept the given word temporarily
        virtual void accept(WordLangTuple const & word);
 
-       /// return the next near miss after a MISSED result
+       /// return the next near miss after a SUGGESTED_WORDS result
        virtual std::string const nextMiss();
 
        /// give an error message on messy exit
index a3b050afca072d18af74477a795ecc347d028510..9ca0feaeeec9882301fdbf6d0324c938943158b4 100644 (file)
@@ -83,7 +83,7 @@ void PSpell::addManager(string const & lang)
 
 enum PSpell::Result PSpell::check(WordLangTuple const & word)
 {
-       Result res = UNKNOWN;
+       Result res = UNKNOWN_WORD;
 
        Managers::iterator it = managers_.find(word.lang_code());
        if (it == managers_.end()) {
@@ -107,9 +107,9 @@ enum PSpell::Result PSpell::check(WordLangTuple const & word)
                BOOST_ASSERT(sugs != 0);
                els = pspell_word_list_elements(sugs);
                if (pspell_word_list_empty(sugs))
-                       res = UNKNOWN;
+                       res = UNKNOWN_WORD;
                else
-                       res = MISSED;
+                       res = SUGGESTED_WORDS;
        }
        return res;
 }
index 2b676d8d438e1a0a983a2eafebfa131235a3c3b0..3323e8a769c674ed576157289b48baf6eee2408d 100644 (file)
@@ -49,7 +49,7 @@ public:
        /// accept the given word temporarily
        virtual void accept(WordLangTuple const &);
 
-       /// return the next near miss after a MISSED result
+       /// return the next near miss after a SUGGESTED_WORDS result
        virtual std::string const nextMiss();
 
        /// give an error message on messy exit