Fix crash.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5513 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-10-25 11:07:18 +00:00
parent c67a37d05d
commit 87bfedd291
2 changed files with 9 additions and 5 deletions

View 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:

View 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