]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbibitem.C
The markDirty() and fitCursor() changes
[lyx.git] / src / insets / insetbibitem.C
index 513a4efd74ea39e3c13a6f2a8f681711360b645e..7fb54eec613fcb485124c5952919ed4c8e923d5d 100644 (file)
@@ -12,6 +12,7 @@
 #include "insetbibitem.h"
 #include "buffer.h"
 #include "BufferView.h"
+#include "funcrequest.h"
 #include "lyxlex.h"
 
 #include "frontends/font_metrics.h"
@@ -48,6 +49,35 @@ Inset * InsetBibitem::clone(Buffer const &, bool) const
 }
 
 
+dispatch_result InsetBibitem::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;
+}
+
+
 void InsetBibitem::setCounter(int c)
 {
        counter = c;
@@ -96,10 +126,10 @@ string const InsetBibitem::getScreenLabel(Buffer const *) const
 }
 
 
-void InsetBibitem::edit(BufferView *, int, int, mouse_button::state)
+void InsetBibitem::edit(BufferView * bv, int, int, mouse_button::state)
 {
        InsetCommandMailer mailer("bibitem", *this);
-       mailer.showDialog();
+       mailer.showDialog(bv);
 }