]> git.lyx.org Git - features.git/commitdiff
fix crash when selecting the last template in external inset
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 24 Oct 2002 13:39:59 +0000 (13:39 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 24 Oct 2002 13:39:59 +0000 (13:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5499 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormExternal.C

index c0055ad37fddfb412c2e47a2173b7004fd33c50a..651eadb1a05884278be897acbada396ad84ba5b9 100644 (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
index b44895f1e2c9d25d0b61e422fd9f94becd97bb45..aee507a291200abe0f8fa5fc0dc0b2e8c1c8a430 100644 (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();