fix crash when selecting the last template in external inset

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5499 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-10-24 13:39:59 +00:00
parent e8eb0d773d
commit c88f7176cc
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-10-23 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* FormExternal.C (apply):
(input): fix an off-by-one index (causing a crash)
2002-10-24 Rob Lahaye <lahaye@snu.ac.kr>
* FormGraphics.C: use checkedWidgets to ensure that the lengths and

View File

@ -41,7 +41,7 @@ void FormExternal::apply()
controller().params().parameters =
fl_get_input(dialog_->input_parameters);
int const choice = fl_get_choice(dialog_->choice_template);
int const choice = fl_get_choice(dialog_->choice_template) - 1;
controller().params().templ = controller().getTemplate(choice);
}
@ -93,7 +93,7 @@ ButtonPolicy::SMInput FormExternal::input(FL_OBJECT * ob, long)
if (ob == dialog_->choice_template) {
// set to the chosen template
int const choice = fl_get_choice(dialog_->choice_template);
int const choice = fl_get_choice(dialog_->choice_template) - 1;
controller().params().templ = controller().getTemplate(choice);
updateComboChange();