From c88f7176cc2669b139bb03ae3006c3759a019943 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 24 Oct 2002 13:39:59 +0000 Subject: [PATCH] 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 --- src/frontends/xforms/ChangeLog | 5 +++++ src/frontends/xforms/FormExternal.C | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index c0055ad37f..651eadb1a0 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2002-10-23 Jean-Marc Lasgouttes + + * FormExternal.C (apply): + (input): fix an off-by-one index (causing a crash) + 2002-10-24 Rob Lahaye * FormGraphics.C: use checkedWidgets to ensure that the lengths and diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index b44895f1e2..aee507a291 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -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(); -- 2.39.2