]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbibtex.C
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetbibtex.C
index 895b7a032b7ce96d5c1a33f41cabfe4a5bf878dc..8970efb5764707444891704d569234a09e3d90a8 100644 (file)
@@ -48,24 +48,30 @@ InsetBibtex::~InsetBibtex()
 
 dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd)
 {
-       if (cmd.action != LFUN_INSET_MODIFY)
-               return UNDISPATCHED;
-
-       InsetCommandParams p;
-       InsetCommandMailer::string2params(cmd.argument, p);
-       if (p.getCmdName().empty())
-               return UNDISPATCHED;
+       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());
+               }
 
-       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);
        }
 
-       setParams(p);
-       if (view())
-               view()->updateInset(this, true);
-
-       return DISPATCHED;
+       return result;
 }
 
 string const InsetBibtex::getScreenLabel(Buffer const *) const
@@ -212,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);
 }