diff --git a/ChangeLog b/ChangeLog index b163fb2ac4..a4bb9b1bc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-10-16 Jean-Marc Lasgouttes + + * src/mathed/math_macro.C (MathMacroTemplate): initialize args to + 0 when there are no arguments. + +2000-10-16 Angus Leeming + + * src/insets/insetbib.C: re-introduce current_view as a temporary fix + to segfaults when pressing Ok in InsetBibtex dialog. + 2000-10-16 Angus Leeming * forms/layout_forms.fd: diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index 330c453e34..1ea8b95d3f 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -31,14 +31,18 @@ FD_bibitem_form * bibitem_form = 0; FD_bibitem_form * create_form_bibitem_form(void); +extern BufferView * current_view; +// This is foul! +// called from both InsetBibKey and InsetBibtex dialogs yet cast off +// only to InsetBibKey holder. Real problems can ensue. extern "C" void bibitem_cb(FL_OBJECT *, long data) { InsetBibKey::Holder * holder = static_cast (bibitem_form->bibitem_form->u_vdata); - + holder->inset->callback( bibitem_form, data ); } @@ -99,12 +103,15 @@ void InsetBibKey::callback( FD_bibitem_form * form, long data ) { switch (data) { case 1: - if(!holder.view->buffer()->isReadonly()) { + // Do NOT change this to + // holder.view->buffer() as this code is used by both + // InsetBibKey and InsetBibtex! Ughhhhhhh!!!! + if(!current_view->buffer()->isReadonly()) { setContents(fl_get_input(form->key)); setOptions(fl_get_input(form->label)); // shouldn't mark the buffer dirty unless // something was actually altered - holder.view->updateInset( this, true ); + current_view->updateInset( this, true ); } // fall through to Cancel case 0: fl_hide_form(form->bibitem_form); diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 3f88d47907..2ddc24d13d 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -265,8 +265,10 @@ MathMacroTemplate::MathMacroTemplate(string const & nm, int na, int flg): for (int i = 0; i < nargs; ++i) { args[i].setNumber(i + 1); } - } else - tcode = LM_TC_INSET; + } else { + tcode = LM_TC_INSET; + args = 0; + } }