]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_nestinset.C
more IU
[lyx.git] / src / mathed / math_nestinset.C
index a603b4d0f5b069d91c3c639a3e58d1c5ca7abf41..36c90752345b9f5985e801c132b0b36cdbcdd3d5 100644 (file)
@@ -15,6 +15,7 @@
 #include "math_mathmlstream.h"
 #include "math_parser.h"
 #include "BufferView.h"
+#include "dispatchresult.h"
 #include "debug.h"
 #include "funcrequest.h"
 #include "LColor.h"
@@ -196,17 +197,6 @@ void MathNestInset::validate(LaTeXFeatures & features) const
 }
 
 
-bool MathNestInset::match(MathAtom const & at) const
-{
-       if (nargs() != at->nargs())
-               return false;
-       for (idx_type i = 0; i < nargs(); ++i)
-               if (!cell(i).match(at->cell(i)))
-                       return false;
-       return true;
-}
-
-
 void MathNestInset::replace(ReplaceData & rep)
 {
        for (idx_type i = 0; i < nargs(); ++i)
@@ -285,8 +275,9 @@ void MathNestInset::notifyCursorLeaves(idx_type idx)
 }
 
 
-dispatch_result MathNestInset::dispatch
-       (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+DispatchResult
+MathNestInset::priv_dispatch(FuncRequest const & cmd,
+                            idx_type & idx, pos_type & pos)
 {
        BufferView * bv = cmd.view();
 
@@ -297,7 +288,7 @@ dispatch_result MathNestInset::dispatch
                        mathed_parse_cell(ar, cmd.argument);
                        cell(idx).insert(pos, ar);
                        pos += ar.size();
-                       return DISPATCHED;
+                       return DispatchResult(true, true);
                }
 
                case LFUN_PASTESELECTION:
@@ -307,8 +298,8 @@ dispatch_result MathNestInset::dispatch
 
                case LFUN_MOUSE_PRESS:
                        if (cmd.button() == mouse_button::button2)
-                               return dispatch(FuncRequest(bv, LFUN_PASTESELECTION), idx, pos);
-                       return UNDISPATCHED;
+                               return priv_dispatch(FuncRequest(bv, LFUN_PASTESELECTION), idx, pos);
+                       return DispatchResult(false);
 
                default:
                        return MathInset::priv_dispatch(cmd, idx, pos);