]> git.lyx.org Git - lyx.git/commitdiff
Fix working of the spellchecker dialog with ispell when there are no
authorAngus Leeming <leeming@lyx.org>
Mon, 1 Oct 2001 14:00:46 +0000 (14:00 +0000)
committerAngus Leeming <leeming@lyx.org>
Mon, 1 Oct 2001 14:00:46 +0000 (14:00 +0000)
known replacements to an incorrectly spelt word.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2829 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlSpellchecker.C

index fc508b77b46e99a61dc55ab207aebbc571eb382d..842c3ad949e19c588fd267877d98bcc55767df06 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-27  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * ControlSpellchecker.C (check): Behaves well now when the spell library
+       doesn't know a replacement to an incorrect word.
+
 2001-09-27  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * ControlSpellchecker.C (clearParams): place emergency_exit_ in
index fa4f6786c9cd23f008da4144e540f913d55716fd..a7d6cad6c7e50c496ee6ab753742c7fe5679082e 100644 (file)
@@ -56,7 +56,7 @@ using SigC::slot;
 ControlSpellchecker::ControlSpellchecker(LyXView & lv, Dialogs & d)
        : ControlDialog<ControlConnectBD>(lv, d),
          rtl_(false), newval_(0.0), oldval_(0), newvalue_(0), count_(0),
-         stop_(false), result_(SpellBase::ISP_UNKNOWN), speller_(0)
+         stop_(false), result_(SpellBase::ISP_OK), speller_(0)
 {
        d_.showSpellchecker.connect(SigC::slot(this, &ControlSpellchecker::show));
 }
@@ -104,10 +104,11 @@ void ControlSpellchecker::setParams()
 
 void ControlSpellchecker::check()
 {
-       result_ = SpellBase::ISP_UNKNOWN;
+       result_ = SpellBase::ISP_OK;
        stop_ = false;
        
-       while (result_!=SpellBase::ISP_MISSED && !stop_) {
+       while ((result_==SpellBase::ISP_OK || result_==SpellBase::ISP_IGNORE) &&
+              !stop_) {
                word_ = lv_.view()->nextWord(newval_);
                
                if (word_.empty()) {
@@ -134,7 +135,7 @@ void ControlSpellchecker::check()
                lv_.view()->selectLastWord();
 
        // set suggestions
-       if (result_==SpellBase::ISP_MISSED) {
+       if (result_!=SpellBase::ISP_OK && result_!=SpellBase::ISP_IGNORE) {
                view().partialUpdate(1);
        }
 }
@@ -240,7 +241,7 @@ void ControlSpellchecker::clearParams()
        count_ = 0;
        message_ = "";
        stop_ = false;
-       result_ = SpellBase::ISP_UNKNOWN;
+       result_ = SpellBase::ISP_OK;
        speller_ = 0;
 }