On Mon, Jan 07, 2002 at 06:55:42PM -0500, [EMAIL PROTECTED] wrote: > I double-clicked on a choice, to replace bMy with My or some such. > > I believe the crash was immediate (the change certainly didn't make it > into the emergency file, but the prior change did.)
well I don't really see how it could happen, but certainly ther attached patch is more robusy. please apply john -- "I went to set up a Yahoo ID for my dog. (Don't ask, but the DOG'S email was cluttering my inbox)." - Ruthless Advisorette
Index: src/frontends/xforms/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v retrieving revision 1.224 diff -u -p -r1.224 ChangeLog --- src/frontends/xforms/ChangeLog 2002/01/07 18:42:29 1.224 +++ src/frontends/xforms/ChangeLog 2002/01/08 00:06:47 @@ -1,3 +1,7 @@ +2002-01-08 John Levon <[EMAIL PROTECTED]> + + * FormSpellchecker.C: fix possible crash on clicking a suggestion + 2002-01-07 Angus Leeming <[EMAIL PROTECTED]> * FormDocument.C: Index: src/frontends/xforms/FormSpellchecker.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormSpellchecker.C,v retrieving revision 1.3 diff -u -p -r1.3 FormSpellchecker.C --- src/frontends/xforms/FormSpellchecker.C 2001/09/18 12:22:08 1.3 +++ src/frontends/xforms/FormSpellchecker.C 2002/01/08 00:06:47 @@ -81,12 +81,17 @@ ButtonPolicy::SMInput FormSpellchecker:: controller().options(); } else if (obj == dialog_->browser) { int sel = fl_get_browser(dialog_->browser); - if (clickline_==sel) { + if (sel < 1) + return ButtonPolicy::SMI_VALID; + + if (clickline_ == sel) { string tmp = fl_get_input(dialog_->input); controller().replace(tmp); } + clickline_ = sel; - string tmp = fl_get_browser_line(dialog_->browser, clickline_); + char const * cptmp = fl_get_browser_line(dialog_->browser, clickline_); + string tmp = (cptmp) ? cptmp : ""; fl_set_input(dialog_->input, tmp.c_str()); }