]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/ref_inset.C
the DocIterator stuff
[lyx.git] / src / mathed / ref_inset.C
index 391cffda4960177a9afffea1668c5ada10e4433d..5089f85ec2be296dde6997044c7e23879043fa1c 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "BufferView.h"
 #include "cursor.h"
-#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "math_support.h"
@@ -54,41 +53,43 @@ void RefInset::infoize(std::ostream & os) const
 }
 
 
-DispatchResult RefInset::priv_dispatch(LCursor & cur, FuncRequest const & cmd)
+void RefInset::priv_dispatch(LCursor & cur, FuncRequest const & cmd)
 {
        switch (cmd.action) {
        case LFUN_INSET_MODIFY:
                if (cmd.getArg(0) == "ref") {
                        MathArray ar;
-                       if (!createMathInset_fromDialogStr(cmd.argument, ar))
-                               return DispatchResult(false);
-                       *this = *ar[0].nucleus()->asRefInset();
-                       return DispatchResult(true, true);
+                       if (createMathInset_fromDialogStr(cmd.argument, ar)) {
+                               *this = *ar[0].nucleus()->asRefInset(); 
+                               break;
+                       }
                }
-               return DispatchResult(false);
+               cur.undispatched();
+               break;
 
        case LFUN_MOUSE_RELEASE:
                if (cmd.button() == mouse_button::button3) {
                        lyxerr << "trying to goto ref" << cell(0) << endl;
                        cur.bv().dispatch(FuncRequest(LFUN_REF_GOTO, asString(cell(0))));
-                       return DispatchResult(true, true);
+                       break;
                }
                if (cmd.button() == mouse_button::button1) {
-                       // Eventually trigger dialog with button 3
-                       // not 1
+                       // Eventually trigger dialog with button 3, not 1
                        string const data = createDialogStr("ref");
                        cur.bv().owner()->getDialogs().show("ref", data, this);
-                       return DispatchResult(true, true);
+                       break;
                }
-               return DispatchResult(false);
+               cur.undispatched();
+               break;
 
        case LFUN_MOUSE_PRESS:
        case LFUN_MOUSE_MOTION:
                // eat other mouse commands
-               return DispatchResult(true, true);
+               break;
 
        default:
-               return CommandInset::priv_dispatch(cur, cmd);
+               CommandInset::priv_dispatch(cur, cmd);
+               break;
        }
 }