> I use the "BitTeX Generated Reference". LyX crashes when
> I open the BibTeX dialog and click on <OK> (<Cancel> does
> not cause a crash):

Looks like this one is my fault, since I hacked the code in insetbib.C so 
that it didn't use current_view. 

Actually, I claim that the fault is in the foul code in this file! This was a 
bug waiting to happen. Patch attached.


This code is a perfect example of why a re-write of the code base has been a 
VERY good idea!

Two classes InsetBibkey and InsetBibtex share one xforms dialog 
FD_bibitem_form * bibitem_form

Pressing Ok in the dialog results in a call to bibitem_cb(). Here, we have a 
cast:
        InsetBibKey::Holder * holder =  
                static_cast<InsetBibKey::Holder*>
                (bibitem_form->bibitem_form->u_vdata);

Even when this callback function is called from the InsetBibtex dialog.

The subsequent call

        holder->inset->callback( bibitem_form, data );

leads to all hell breaking loose when trying to find the parent buffer.

This is an example of (bad) code that was written a long, long time ago and 
subsequently hacked many times. Mainly by me. One hack too far and it all 
falls to pieces.

Angus

patch_bibtex.bz2

Reply via email to