]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbibtex.C
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetbibtex.C
index 95c97a52503169fb370fb91f4b679729b1dd9b68..8970efb5764707444891704d569234a09e3d90a8 100644 (file)
@@ -12,7 +12,9 @@
 
 #include "insetbibtex.h"
 #include "buffer.h"
+#include "BufferView.h"
 #include "debug.h"
+#include "funcrequest.h"
 #include "gettext.h"
 
 #include "support/filetools.h"
@@ -44,6 +46,34 @@ InsetBibtex::~InsetBibtex()
 }
 
 
+dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd)
+{
+       Inset::RESULT result = UNDISPATCHED;
+
+       switch (cmd.action) {
+       case LFUN_INSET_MODIFY: {
+               InsetCommandParams p;
+               InsetCommandMailer::string2params(cmd.argument, p);
+               if (p.getCmdName().empty())
+                       break;
+
+               if (view() && p.getContents() != params().getContents()) {
+                       view()->ChangeCitationsIfUnique(params().getContents(),
+                                                       p.getContents());
+               }
+
+               setParams(p);
+               cmd.view()->updateInset(this);
+               result = DISPATCHED;
+       }
+       break;
+       default:
+               result = InsetCommand::localDispatch(cmd);
+       }
+
+       return result;
+}
+
 string const InsetBibtex::getScreenLabel(Buffer const *) const
 {
        return _("BibTeX Generated References");
@@ -188,10 +218,10 @@ void InsetBibtex::fillWithBibKeys
 }
 
 
-void InsetBibtex::edit(BufferView *, int, int, mouse_button::state)
+void InsetBibtex::edit(BufferView * bv, int, int, mouse_button::state)
 {
        InsetCommandMailer mailer("bibtex", *this);
-       mailer.showDialog();
+       mailer.showDialog(bv);
 }