]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.C
fix deletion of subscript if superscript is present and vice versa
[lyx.git] / src / mathed / formulabase.C
index f5c457b8de5fdbf2d5c9b321f593162c5599e2f2..18e1c97ba2a17f4b24e8e18d7bab9366309457b4 100644 (file)
@@ -191,8 +191,6 @@ void InsetFormulaBase::edit(BufferView * bv, int x, int /*y*/, unsigned int)
 
 void InsetFormulaBase::edit(BufferView * bv, bool front)
 {
-#warning Please have a look if this is right (Jug)
-#warning Does not look wrong... although I do not know what it is supposed to do (Andre)
        edit(bv, front ? 0 : 1, 0, 0);
 }
 
@@ -449,25 +447,14 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                break;
 
        case LFUN_BACKSPACE:
-               // if (!mathcursor->inMacroMode() && mathcursor->pos() == 0)
-               if (mathcursor->pos() == 0) {
-                       bv->lockedInsetStoreUndo(Undo::DELETE);
-                       mathcursor->pullArg(false);
-                       bv->updateInset(this, true);
-                       break;
-               }
-               if (mathcursor->inMacroMode())
-                       mathcursor->left();
-               else
-                       mathcursor->plainLeft();
-               // fall through...
+               bv->lockedInsetStoreUndo(Undo::DELETE);
+               mathcursor->backspace();
+               bv->updateInset(this, true);
+               break;
 
        case LFUN_DELETE:
                bv->lockedInsetStoreUndo(Undo::DELETE);
-               if (mathcursor->pos() == mathcursor->array().size()) 
-                       mathcursor->pullArg(true);
-               else
-                       mathcursor->erase();
+               mathcursor->erase();
                bv->updateInset(this, true);
                break;
 
@@ -559,15 +546,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                //bv->owner()->message(_("math text mode toggled"));
                break;
 
-#ifndef NO_LATEX
-       case LFUN_TEX:
-               if (!mathcursor->selection()) {
-                       mathcursor->handleFont(LM_TC_TEX);
-                       //bv->owner()->message(_("TeX mode toggled"));
-               }
-               break;
-#endif
-
        case LFUN_MATH_LIMITS:
                bv->lockedInsetStoreUndo(Undo::INSERT);
                if (mathcursor->toggleLimits())
@@ -901,17 +879,6 @@ Inset::Code InsetFormulaBase::lyxCode() const
 }
 
 
-LyXFont const InsetFormulaBase::convertFont(LyXFont const & f) const
-{
-       // We have already discussed what was here
-       LyXFont font(f);
-#ifndef NO_LATEX
-       font.setLatex(LyXFont::OFF);
-#endif
-       return font;
-}
-
-
 void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
 {
        if (bv->available()) {