From: Angus Leeming Date: Fri, 25 Oct 2002 11:07:18 +0000 (+0000) Subject: Fix crash. X-Git-Tag: 1.6.10~18086 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=87bfedd291d7bd8181bf76ac1492d2d7846e2dab;p=features.git Fix crash. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5513 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 31867bb9f7..76d7fd3ccb 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2002-10-25 Angus Leeming + + * FormSpellchecker.C (input): fix crash when progress == 0. + 2002-10-24 Rob Lahaye * forms/form_print.fd: diff --git a/src/frontends/xforms/FormSpellchecker.C b/src/frontends/xforms/FormSpellchecker.C index 48464e88b5..56b2f262da 100644 --- a/src/frontends/xforms/FormSpellchecker.C +++ b/src/frontends/xforms/FormSpellchecker.C @@ -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