case LFUN_MATH_EXTERN:
case LFUN_TABULAR_FEATURE:
case LFUN_PASTESELECTION:
+ case LFUN_MATH_LIMITS:
bv->lockedInsetStoreUndo(Undo::EDIT);
mathcursor->dispatch(cmd);
updateLocal(bv, true);
//bv->owner()->message(_("math text mode toggled"));
break;
- case LFUN_MATH_LIMITS:
- bv->lockedInsetStoreUndo(Undo::EDIT);
- if (mathcursor->toggleLimits())
- updateLocal(bv, true);
- break;
-
case LFUN_MATH_SIZE:
#if 0
if (!arg.empty()) {
}
-bool MathCursor::toggleLimits()
-{
- if (!hasNextAtom() || !nextAtom()->asScriptInset())
- return false;
- MathScriptInset * t = nextAtom().nucleus()->asScriptInset();
- int old = t->limits();
- t->limits(old < 0 ? 1 : -1);
- return old != t->limits();
-}
-
-
void MathCursor::macroModeClose()
{
if (!inMacroMode())
bool interpret(string const &);
///
bool interpret(char);
- ///
- bool toggleLimits();
/// interpret name a name of a macro
void macroModeClose();
/// are we currently typing the name of a macro?
void Parser::parse1(MathGridInset & grid, unsigned flags,
mode_type mode, bool numbered)
{
- int limits = 0;
+ int limits = 0;
MathGridInset::row_type cellrow = 0;
MathGridInset::col_type cellcol = 0;
MathArray * cell = &grid.cell(grid.index(cellrow, cellcol));
else
cell->back() = MathAtom(new MathScriptInset(cell->back(), up));
MathScriptInset * p = cell->back().nucleus()->asScriptInset();
- parse(p->cell(up), FLAG_ITEM, mode);
- p->limits(limits);
- limits = 0;
// special handling of {}-bases
// is this always correct?
if (p->nuc().size() == 1 && p->nuc().back()->asNestInset() &&
p->nuc().back()->extraBraces())
p->nuc() = p->nuc().back()->asNestInset()->cell(0);
+ parse(p->cell(up), FLAG_ITEM, mode);
+ if (limits) {
+ p->limits(limits);
+ limits = 0;
+ }
}
}
#include "math_support.h"
#include "math_symbolinset.h"
#include "math_mathmlstream.h"
+#include "funcrequest.h"
#include "support/LAssert.h"
#include "debug.h"
if (limits_)
os << (limits_ == 1 ? ", Displayed limits" : ", Inlined limits");
}
+
+
+MathInset::result_type MathScriptInset::dispatch
+ (FuncRequest const & cmd, idx_type & idx, pos_type & pos)
+{
+ if (cmd.action == LFUN_MATH_LIMITS) {
+ limits_ = limits_ < 0 ? 1 : -1;
+ return DISPATCHED;
+ }
+
+ return MathNestInset::dispatch(cmd, idx, pos);
+}
void ensure(bool up);
///
void infoize(std::ostream & os) const;
+ /// local dispatcher
+ result_type dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
private:
/// returns x offset for main part