thanks john -- "I'm not sure which upsets me more: that people are so unwilling to accept responsibility for their own actions, or that they are so eager to regulate everyone else's." - Kee Hinckley
Index: ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v retrieving revision 1.142 diff -u -r1.142 ChangeLog --- ChangeLog 2001/08/29 16:00:14 1.142 +++ ChangeLog 2001/08/31 22:49:59 @@ -1,3 +1,7 @@ +2001-08-31 John Levon <[EMAIL PROTECTED]> + + * FormParagraph.C: fix to not allow 0 linespacing + 2001-08-29 Angus Leeming <[EMAIL PROTECTED]> * FormCitation.C (c-tor): prevent re-sizing of the dialog. Index: FormParagraph.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormParagraph.C,v retrieving revision 1.35 diff -u -r1.35 FormParagraph.C --- FormParagraph.C 2001/08/29 16:00:14 1.35 +++ FormParagraph.C 2001/08/31 22:49:59 @@ -433,7 +437,7 @@ bool FormParagraph::input(FL_OBJECT * ob, long) { - bool ret = true; + bool valid = true; fl_hide_object(dialog_->text_warning); @@ -457,27 +472,42 @@ } string input = fl_get_input (dialog_->input_space_above); - bool invalid = false; - if (fl_get_choice(dialog_->choice_space_above)==7) - invalid = !input.empty() && !isValidGlueLength(input); + if (fl_get_choice(dialog_->choice_space_above)==7 && + input.empty() || !isValidGlueLength(input)) + valid = false; + + if (ob == dialog_->input_space_above) { + if (!isValidGlueLength(input)) { + fl_set_object_label(dialog_->text_warning, + _("Warning: Invalid Length (valid example: 10mm)")); + fl_show_object(dialog_->text_warning); + valid = false; + } else + fl_hide_object(dialog_->text_warning); + } input = fl_get_input (dialog_->input_space_below); - if (fl_get_choice(dialog_->choice_space_below)==7) - invalid = invalid || (!input.empty() && !isValidGlueLength(input)); - - if (ob == dialog_->input_space_above || ob == dialog_->input_space_below) { - if (invalid) { + if (fl_get_choice(dialog_->choice_space_below)==7 && + input.empty() || !isValidGlueLength(input)) + valid = false; + + if (ob == dialog_->input_space_below) { + if (!isValidGlueLength(input)) { fl_set_object_label(dialog_->text_warning, _("Warning: Invalid Length (valid example: 10mm)")); fl_show_object(dialog_->text_warning); - return false; - } else { + valid = false; + } else fl_hide_object(dialog_->text_warning); - return true; - } } + + double spacing(strToDbl(fl_get_input(dialog_->input_linespacing))); + + if (fl_get_choice (dialog_->choice_linespacing) == 5 + && int(spacing) == 0) + valid = false; - return ret; + return valid; }