]> git.lyx.org Git - features.git/commitdiff
Fix crash.
authorAngus Leeming <leeming@lyx.org>
Fri, 25 Oct 2002 11:07:18 +0000 (11:07 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 25 Oct 2002 11:07:18 +0000 (11:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5513 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormSpellchecker.C

index 31867bb9f76bb69faf31ae1ca7814e6db5d72ce7..76d7fd3ccbd744532996680e253d4688824a52c1 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-25  Angus Leeming  <leeming@lyx.org>
+
+       * FormSpellchecker.C (input): fix crash when progress == 0.
+
 2002-10-24  Rob Lahaye  <lahaye@snu.ac.kr>
 
        * forms/form_print.fd:
index 48464e88b541bccd840f62a38b0169965a53785c..56b2f262da104b0b6c6215f7255d42db6780ac32 100644 (file)
@@ -160,8 +160,8 @@ ButtonPolicy::SMInput FormSpellchecker::input(FL_OBJECT * ob, long ob_value)
 
        // update slider with word count and progress
        double const wordcount = controller().getCount();
-       if (wordcount > 0.0) {
-               int const progress = controller().getProgress();
+       int const progress = controller().getProgress();
+       if (wordcount > 0.0 && progress > 0) {
                double const total = 100.0 * wordcount / progress;
 
                fl_set_slider_bounds(dialog_->slider_progress, 0.0, total);
@@ -178,7 +178,7 @@ void FormSpellchecker::partialUpdate(int id)
 {
        switch (id) {
        case 1: // set suggestions
-               {
+       {
                string w = controller().getWord();
                fl_set_input(dialog_->input_replacement, w.c_str());
                fl_set_object_label(dialog_->text_unknown, w.c_str());
@@ -186,8 +186,8 @@ void FormSpellchecker::partialUpdate(int id)
                while (!(w = controller().getSuggestion()).empty()) {
                        fl_add_browser_line(dialog_->browser_suggestions, w.c_str());
                }
-               }
-               break;
+       }
+       break;
        case 2: // end of spell checking
 
                // reset dialog and buttons into start condition