From: Dekel Tsur Date: Fri, 21 Sep 2001 18:19:16 +0000 (+0000) Subject: Fix crash when using dialog with keyboard: X-Git-Tag: 1.6.10~20568 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1981eeb134b9a3e32c3b1b39f89f554a624c6a3a;p=features.git Fix crash when using dialog with keyboard: The problem also happen with other dialogs. For example, open the document dialog, press alt+p (pagestyle), and press enter -> The pagestyle button becomes empty. Furthermore, when pressing "Apply", lyx will crash. I havn't fixed the other dialogs, because I don't know if my fix is good (maybe there is a simple fix to the problem). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2788 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index ab7b5e90b9..d9a0e92471 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2001-09-21 Dekel Tsur + + * FormRef.C (input): Fix crash when using dialog with keyboard. + 2001-09-20 Jürgen Spitzmüller * forms/form_document.fd: small tweaks. diff --git a/src/frontends/xforms/FormRef.C b/src/frontends/xforms/FormRef.C index b4a64c3e1b..909c8ec304 100644 --- a/src/frontends/xforms/FormRef.C +++ b/src/frontends/xforms/FormRef.C @@ -197,6 +197,9 @@ ButtonPolicy::SMInput FormRef::input(FL_OBJECT * ob, long) } else if (ob == dialog_->button_update || ob == dialog_->sort || ob == dialog_->buffer) { + if (ob == dialog_->buffer && + fl_get_choice(dialog_->buffer) < 1) + fl_set_choice(dialog_->buffer, 1); if (ob == dialog_->button_update || ob == dialog_->buffer) { @@ -210,6 +213,8 @@ ButtonPolicy::SMInput FormRef::input(FL_OBJECT * ob, long) fl_unfreeze_form(form()); } else if (ob == dialog_->type) { + if (fl_get_choice(dialog_->type) < 1) + fl_set_choice(dialog_->type, 1); int const type = fl_get_choice(dialog_->type) - 1; if (controller().params().getCmdName() ==