On Fri, Dec 14, 2001 at 05:42:29PM +1000, Allan Rae wrote: > My case is a multipart document and chapters are in separate docs. So > this is the same as an empty doc?
dunno, does the current document not contain any entries ? > But sadly the unattached fix doesn't work for me. frankly pathetic. here you go, since you whiny types seem to need patches ... regards john -- "Of all manifestations of power, restraint impresses the most." - Thucydides
Index: src/frontends/xforms/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v retrieving revision 1.211 diff -u -r1.211 ChangeLog --- src/frontends/xforms/ChangeLog 2001/12/12 09:56:02 1.211 +++ src/frontends/xforms/ChangeLog 2001/12/14 06:09:26 @@ -1,3 +1,8 @@ +2001-12-14 John Levon <[EMAIL PROTECTED]> + + * FormToc.C: fix crash when no entries, and + update types properly + 2001-12-11 Ben Stanley <[EMAIL PROTECTED]> * Menubar_pimpl.C: Fixed a crashing bug when document has more Index: src/frontends/xforms/FormToc.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/FormToc.C,v retrieving revision 1.29 diff -u -r1.29 FormToc.C --- src/frontends/xforms/FormToc.C 2001/11/27 10:56:13 1.29 +++ src/frontends/xforms/FormToc.C 2001/12/14 06:09:26 @@ -55,8 +55,12 @@ } -ButtonPolicy::SMInput FormToc::input(FL_OBJECT *, long) +ButtonPolicy::SMInput FormToc::input(FL_OBJECT * ob, long) { + if (ob != dialog_->choice_toc_type) { + updateType(); + } + updateContents(); unsigned int const choice = fl_get_browser( dialog_->browser_toc ); @@ -74,6 +78,7 @@ // Update the choice list from scratch fl_clear_choice(dialog_->choice_toc_type); string const choice = getStringFromVector(controller().getTypes(), "|"); + lyxerr << "choice " << choice << endl; fl_addto_choice(dialog_->choice_toc_type, choice.c_str()); // And select the correct one @@ -95,8 +100,16 @@ void FormToc::updateContents() { - string const type = - frontStrip(strip(fl_get_choice_text(dialog_->choice_toc_type))); + char const * tmp = fl_get_choice_text(dialog_->choice_toc_type); + + if (!tmp) { + fl_clear_browser(dialog_->browser_toc); + fl_add_browser_line(dialog_->browser_toc, + _("*** No Lists ***")); + return; + } + + string const type = frontStrip(strip(tmp)); Buffer::SingleList const contents = controller().getContents(type);