]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathNest.cpp
Removed unused private variable
[lyx.git] / src / mathed / InsetMathNest.cpp
index a03aaefb168a38304e91042f1d076bc59d1a13bd..b026b888f03046c89ddb4139e63e14ee644c9547 100644 (file)
@@ -235,7 +235,7 @@ bool InsetMathNest::idxFirst(Cursor & cur) const
        LASSERT(&cur.inset() == this, return false);
        if (nargs() == 0)
                return false;
-       cur.idx() = 0;
+       cur.idx() = firstIdx();
        cur.pos() = 0;
        return true;
 }
@@ -246,7 +246,7 @@ bool InsetMathNest::idxLast(Cursor & cur) const
        LASSERT(&cur.inset() == this, return false);
        if (nargs() == 0)
                return false;
-       cur.idx() = cur.lastidx();
+       cur.idx() = lastIdx();
        cur.pos() = cur.lastpos();
        return true;
 }
@@ -1246,22 +1246,6 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                break;
        }
 
-       case LFUN_UNICODE_INSERT: {
-               if (cmd.argument().empty())
-                       break;
-               docstring hexstring = cmd.argument();
-               if (isHex(hexstring)) {
-                       char_type c = hexToInt(hexstring);
-                       if (c >= 32 && c < 0x10ffff) {
-                               docstring s = docstring(1, c);
-                               FuncCode code = currentMode() == MATH_MODE ?
-                                       LFUN_MATH_INSERT : LFUN_SELF_INSERT;
-                               lyx::dispatch(FuncRequest(code, s));
-                       }
-               }
-               break;
-       }
-
        case LFUN_DIALOG_SHOW_NEW_INSET: {
                docstring const & name = cmd.argument();
                string data;
@@ -1486,10 +1470,9 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd,
 void InsetMathNest::edit(Cursor & cur, bool front, EntryDirection entry_from)
 {
        cur.push(*this);
-       bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_RIGHT ||
+       bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT ||
                (entry_from == Inset::ENTRY_DIRECTION_IGNORE && front));
-       cur.idx() = enter_front ? 0 : cur.lastidx();
-       cur.pos() = enter_front ? 0 : cur.lastpos();
+       enter_front ? idxFirst(cur) : idxLast(cur);
        cur.resetAnchor();
        //lyxerr << "InsetMathNest::edit, cur:\n" << cur << endl;
 }
@@ -1729,7 +1712,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
                        MathAtom const atom = cur.prevAtom();
                        if (atom->asNestInset() && atom->isActive()) {
                                cur.posBackward();
-                               cur.pushBackward(*cur.nextInset());
+                               cur.nextInset()->edit(cur, true);
                        }
                }
                if (c == '{')