- /*
+/*
* File: formulabase.C
* Purpose: Implementation of common parts of the LyX math insets
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
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;
}
if (c == ' ') {
- MathSpaceInset * p = prevSpaceInset();
- if (p) {
- p->incSpace();
+ if (hasPrevAtom() && prevAtom()->asSpaceInset()) {
+ prevAtom()->asSpaceInset()->incSpace();
return;
}
}
-MathSpaceInset * MathCursor::prevSpaceInset() const
-{
- if (!hasPrevAtom())
- return 0;
- return prevAtom()->asSpaceInset();
-}
///
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;