]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetexternal.C
fix #832
[lyx.git] / src / insets / insetexternal.C
index aae22af7f8fcf5860f9c5c8d6608abf3909d7806..fa27977806cde4790530e2b4a7290514338532fe 100644 (file)
@@ -34,7 +34,6 @@
 #include <cstdio>
 #include <utility>
 
-
 using std::ostream;
 using std::endl;
 
@@ -64,37 +63,30 @@ InsetExternal::Params const & InsetExternal::params() const
 
 dispatch_result InsetExternal::localDispatch(FuncRequest const & cmd)
 {
-       dispatch_result result = UNDISPATCHED;
-
        switch (cmd.action) {
+
        case LFUN_INSET_MODIFY: {
                InsetExternal::Params p;
                InsetExternalMailer::string2params(cmd.argument, p);
-               if (p.filename.empty())
-                       break;
-
-               setFromParams(p);
-               cmd.view()->updateInset(this);
-               result = DISPATCHED;
+               if (!p.filename.empty()) {
+                       setFromParams(p);
+                       cmd.view()->updateInset(this);
+               }
+               return DISPATCHED;
        }
-       break;
 
-       case LFUN_INSET_DIALOG_UPDATE: {
-               InsetExternalMailer mailer(*this);
-               mailer.updateDialog(cmd.view());
-       }
-       break;
+       case LFUN_INSET_DIALOG_UPDATE:
+               InsetExternalMailer(*this).updateDialog(cmd.view());
+               return DISPATCHED;
 
        case LFUN_MOUSE_RELEASE:
-               edit(cmd.view(), cmd.x, cmd.y, cmd.button());
-               result = DISPATCHED;
-               break;
+       case LFUN_INSET_EDIT:
+               InsetExternalMailer(*this).showDialog(cmd.view());
+               return DISPATCHED;
 
        default:
-               break;
+               return UNDISPATCHED;
        }
-
-       return result;
 }
 
 
@@ -112,19 +104,6 @@ string const InsetExternal::editMessage() const
 }
 
 
-void InsetExternal::edit(BufferView * bv, int, int, mouse_button::state)
-{
-       InsetExternalMailer mailer(*this);
-       mailer.showDialog(bv);
-}
-
-
-void InsetExternal::edit(BufferView * bv, bool)
-{
-       edit(bv, 0, 0, mouse_button::none);
-}
-
-
 void InsetExternal::write(Buffer const *, ostream & os) const
 {
        os << "External " << params_.templ.lyxName << ",\""