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
}
-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);
}