Asger needed a part of this (IGNORE -> IGNORED_WORD) to compile with MSVC.
The rest is just needless fiddling.
--
Angus
Index: src/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2094
diff -u -p -r1.2094 ChangeLog
--- src/ChangeLog 20 Jan 2005 15:07:35 -0000 1.2094
+++ src/ChangeLog 20 Jan 2005 16:13:41 -0000
@@ -1,4 +1,17 @@
+2005-01-20 Angus Leeming <[EMAIL PROTECTED]>
+
+ * 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 <[EMAIL PROTECTED]>
+
+ * buffer.C: add #include <fstream>.
* lyx_main.C (init): Compile fix.
Index: src/SpellBase.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/SpellBase.h,v
retrieving revision 1.8
diff -u -p -r1.8 SpellBase.h
--- src/SpellBase.h 6 Oct 2003 15:42:04 -0000 1.8
+++ src/SpellBase.h 20 Jan 2005 16:13:41 -0000
@@ -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: src/aspell.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/aspell.C,v
retrieving revision 1.11
diff -u -p -r1.11 aspell.C
--- src/aspell.C 5 Jan 2005 20:21:23 -0000 1.11
+++ src/aspell.C 20 Jan 2005 16:13:41 -0000
@@ -75,7 +75,7 @@ void ASpell::addSpeller(string const & l
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(WordLangTup
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: src/aspell_local.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/aspell_local.h,v
retrieving revision 1.4
diff -u -p -r1.4 aspell_local.h
--- src/aspell_local.h 5 Jan 2005 20:21:23 -0000 1.4
+++ src/aspell_local.h 20 Jan 2005 16:13:41 -0000
@@ -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: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.604
diff -u -p -r1.604 buffer.C
--- src/buffer.C 19 Jan 2005 15:26:39 -0000 1.604
+++ src/buffer.C 20 Jan 2005 16:13:43 -0000
@@ -79,6 +79,7 @@
#include <iomanip>
#include <stack>
#include <sstream>
+#include <fstream>
using lyx::pos_type;
Index: src/ispell.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ispell.C,v
retrieving revision 1.24
diff -u -p -r1.24 ispell.C
--- src/ispell.C 26 Mar 2004 23:55:32 -0000 1.24
+++ src/ispell.C 20 Jan 2005 16:13:44 -0000
@@ -373,18 +373,18 @@ enum ISpell::Result ISpell::check(WordLa
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(WordLa
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(WordLa
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: src/ispell.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ispell.h,v
retrieving revision 1.9
diff -u -p -r1.9 ispell.h
--- src/ispell.h 6 Oct 2003 15:42:15 -0000 1.9
+++ src/ispell.h 20 Jan 2005 16:13:44 -0000
@@ -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: src/pspell.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/pspell.C,v
retrieving revision 1.14
diff -u -p -r1.14 pspell.C
--- src/pspell.C 6 Oct 2003 15:42:32 -0000 1.14
+++ src/pspell.C 20 Jan 2005 16:13:44 -0000
@@ -83,7 +83,7 @@ void PSpell::addManager(string const & l
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(WordLa
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: src/pspell.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/pspell.h,v
retrieving revision 1.7
diff -u -p -r1.7 pspell.h
--- src/pspell.h 6 Oct 2003 15:42:32 -0000 1.7
+++ src/pspell.h 20 Jan 2005 16:13:44 -0000
@@ -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: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.466
diff -u -p -r1.466 ChangeLog
--- src/frontends/controllers/ChangeLog 17 Jan 2005 18:54:01 -0000 1.466
+++ src/frontends/controllers/ChangeLog 20 Jan 2005 16:13:48 -0000
@@ -1,3 +1,7 @@
+2005-01-20 Angus Leeming <[EMAIL PROTECTED]>
+
+ * ControlSpellchecker.C (check): s/IGNORE/IGNORED_WORD/.
+
2005-01-17 Angus Leeming <[EMAIL PROTECTED]>
* tex_helpers.C (rescanTexStyles): prepend the name of the
Index: src/frontends/controllers/ControlSpellchecker.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlSpellchecker.C,v
retrieving revision 1.78
diff -u -p -r1.78 ControlSpellchecker.C
--- src/frontends/controllers/ControlSpellchecker.C 6 Jan 2005 16:39:33 -0000 1.78
+++ src/frontends/controllers/ControlSpellchecker.C 20 Jan 2005 16:13:49 -0000
@@ -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);
}