diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 7d5f21c3a0..eebcfc8703 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -1,4 +1,4 @@ - /* +/* * File: formulabase.C * Purpose: Implementation of common parts of the LyX math insets * Author: Alejandro Aguilar Sierra @@ -508,11 +508,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, case LFUN_MATH_SPACE: { bv->lockedInsetStoreUndo(Undo::EDIT); - //MathSpaceInset * p = mathcursor->prevSpaceInset(); - //if (p) - // p->incSpace(); - //else - // mathcursor->insert(new MathSpaceInset(1)); mathcursor->insert(MathAtom(new MathSpaceInset(1))); updateLocal(bv, true); break; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 0129b4531e..a0d1ecbb43 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1340,9 +1340,8 @@ void MathCursor::interpret(char c) } if (c == ' ') { - MathSpaceInset * p = prevSpaceInset(); - if (p) { - p->incSpace(); + if (hasPrevAtom() && prevAtom()->asSpaceInset()) { + prevAtom()->asSpaceInset()->incSpace(); return; } @@ -1465,9 +1464,3 @@ MathCursorPos MathCursor::normalAnchor() const } -MathSpaceInset * MathCursor::prevSpaceInset() const -{ - if (!hasPrevAtom()) - return 0; - return prevAtom()->asSpaceInset(); -} diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index f6e50b218a..3129380265 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -242,23 +242,11 @@ public: /// MathCursorPos const & cursor() const; - - /// - pos_type last() const; /// void seldump(char const * str) const; /// void dump(char const * str) const; - /// - void merge(MathArray const & arr); - /// - MathScriptInset * prevScriptInset() const; - /// - MathSpaceInset * prevSpaceInset() const; - /// glue adjacent atoms if possible - bool glueAdjacentAtoms(); - /// friend class Selection;