]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.C
bugfix (invalid cursor position)
[lyx.git] / src / mathed / formula.C
index 65fe6aefab62cb1a266193a863889aec2ed1b052..b3a648990301f0de03235280a3ce2f0ac943e6e8 100644 (file)
@@ -76,7 +76,7 @@ InsetFormula::InsetFormula(string const & s)
 }
 
 
-Inset * InsetFormula::clone(Buffer const &) const
+Inset * InsetFormula::clone(Buffer const &, bool) const
 {
        return new InsetFormula(*this);
 }
@@ -176,13 +176,6 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
                        updateLocal(bv);
                        break;
 
-
-               case LFUN_DELETE_LINE_FORWARD:
-                       bv->lockedInsetStoreUndo(Undo::DELETE);
-                       mathcursor->DelLine();
-                       updateLocal(bv);
-                       break;
-
                case LFUN_MATH_NUMBER:
                {
                        //lyxerr << "toggling all numbers\n";
@@ -269,14 +262,21 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
                }
 
                case LFUN_MATH_DISPLAY:
+               {
+                       int x;
+                       int y;
+                       mathcursor->GetPos(x, y);
                        if (par()->GetType() == LM_OT_SIMPLE) {
                                par()->mutate(LM_OT_EQUATION);
                                par()->numbered(0, false);
                        }
                        else
                                par()->mutate(LM_OT_SIMPLE);
+                       mathcursor->SetPos(x, y);
+                       mathcursor->normalize();
                        updateLocal(bv);
                        break;
+               }
 
                default:
                        result = InsetFormulaBase::localDispatch(bv, action, arg);