]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_nestinset.C
rename priv_dispatch to doDispatch
[lyx.git] / src / mathed / math_nestinset.C
index d3ca2922d07c2ff56c6d06d1332f182f6cffb6c8..79d058907e3ce0f105bca9010f9d95b3ddebe3d4 100644 (file)
@@ -380,7 +380,7 @@ void MathNestInset::handleFont2(LCursor & cur, string const & arg)
 }
 
 
-void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
+void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd)
 {
        //lyxerr << "MathNestInset: request: " << cmd << std::endl;
        //CursorSlice sl = cur.current();
@@ -684,6 +684,9 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_MATH_MODE:
 #if 1
+               // ignore math-mode on when already in math mode
+               if (currentMode() == InsetBase::MATH_MODE && cmd.argument == "on")
+                       break;
                cur.macroModeClose();
                selClearOrDel(cur);
                cur.plainInsert(MathAtom(new MathMBoxInset(cur.bv())));
@@ -791,7 +794,7 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        default:
-               MathDimInset::priv_dispatch(cur, cmd);
+               MathDimInset::doDispatch(cur, cmd);
                break;
        }
 }
@@ -927,7 +930,7 @@ void MathNestInset::lfunMouseMotion(LCursor & cur, FuncRequest & cmd)
        if (cmd.button() == mouse_button::button1) {
                LCursor & bvcur = cur.bv().cursor();
                if (abs(cmd.x - first_x) + abs(cmd.y - first_y) > 4
-        && bvcur.anchor_.hasPart(cur)) {
+                   && bvcur.anchor_.hasPart(cur)) {
                        first_x = cmd.x;
                        first_y = cmd.y;