[There are times when I simply forget thing, Herbert...]


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5143 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-08-28 17:59:32 +00:00
parent cd4d035577
commit b6453203d2
6 changed files with 22 additions and 23 deletions

View File

@ -423,6 +423,7 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
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);
@ -603,12 +604,6 @@ Inset::RESULT InsetFormulaBase::localDispatch(FuncRequest const & cmd)
//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()) {

View File

@ -526,17 +526,6 @@ bool MathCursor::down(bool sel)
}
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())

View File

@ -127,8 +127,6 @@ public:
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?

View File

@ -550,7 +550,7 @@ void Parser::parse2(MathAtom & at, unsigned flags, mode_type mode,
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));
@ -710,14 +710,16 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
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;
}
}
}

View File

@ -6,6 +6,7 @@
#include "math_support.h"
#include "math_symbolinset.h"
#include "math_mathmlstream.h"
#include "funcrequest.h"
#include "support/LAssert.h"
#include "debug.h"
@ -481,3 +482,15 @@ void MathScriptInset::infoize(std::ostream & os) const
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);
}

View File

@ -91,6 +91,8 @@ public:
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