]> git.lyx.org Git - features.git/blobdiff - src/insets/insetbib.C
Backup file patch from Dekel; Update to scr layout files from Hartmut Goebel
[features.git] / src / insets / insetbib.C
index b38c864729baf0bd660abddd77918e7e37b7c142..7887b6f6ae4e8a4abeb345a766092c2540f28589 100644 (file)
@@ -220,7 +220,8 @@ InsetBibKey::InsetBibKey(InsetBibKey const * b):
 InsetBibKey::~InsetBibKey()
 {
        if(bibitem_form && bibitem_form->bibitem_form
-          && bibitem_form->bibitem_form->visible)
+          && bibitem_form->bibitem_form->visible
+          && bibitem_form->bibitem_form->u_vdata == &holder)
                fl_hide_form(bibitem_form->bibitem_form);
 }
 
@@ -303,6 +304,14 @@ InsetBibtex::InsetBibtex(string const & dbase, string const & style,
 {
 }
 
+InsetBibtex::~InsetBibtex()
+{
+       if(bibitem_form && bibitem_form->bibitem_form
+          && bibitem_form->bibitem_form->visible
+          && bibitem_form->bibitem_form->u_vdata == &holder)
+               fl_hide_form(bibitem_form->bibitem_form);
+}
+
 
 string InsetBibtex::getScreenLabel() const
 {
@@ -404,7 +413,7 @@ string InsetBibtex::getKeys(char delim)
 
 
 // BibTeX should have its own dialog. This is provisional.
-void InsetBibtex::Edit(BufferView *, int, int, unsigned int)
+void InsetBibtex::Edit(BufferView * bv, int, int, unsigned int)
 {
        if (!bibitem_form) {
                bibitem_form = create_form_bibitem_form();
@@ -412,7 +421,10 @@ void InsetBibtex::Edit(BufferView *, int, int, unsigned int)
                                    CancelCloseBoxCB, 0);
        }
 
-       bibitem_form->bibitem_form->u_vdata = this;
+       holder.inset = this;
+       holder.view = bv;
+       bibitem_form->bibitem_form->u_vdata = &holder;
+
        fl_set_object_label(bibitem_form->key, _("Database:"));
        fl_set_object_label(bibitem_form->label, _("Style:  "));
        fl_set_input(bibitem_form->key, getContents().c_str());