small steps towards a unified symbol handling

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2361 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-07-26 15:28:45 +00:00
parent 1db325d20c
commit 356d7aed23
6 changed files with 8 additions and 28 deletions

View File

@ -18,7 +18,7 @@ MathInset * MathBigopInset::clone() const
void MathBigopInset::write(ostream & os, bool /* fragile */) const
{
os << '\\' << sym_->name;
os << '\\' << sym_->name << ' ';
}
@ -35,7 +35,7 @@ void MathBigopInset::metrics(MathStyles st)
if (sym_->id > 0 && sym_->id < 256) {
ssym_ = string();
ssym_ += sym_->id;
code_ = LM_TC_BSYM;
code_ = (sym_->token == LM_TK_BIGSYM) ? LM_TC_BSYM : LM_TC_SYMB;
} else {
ssym_ = sym_->name;
code_ = LM_TC_TEXTRM;

View File

@ -665,19 +665,11 @@ void MathCursor::interpret(string const & s)
p = new MathFuncInset(s);
} else {
switch (l->token) {
case LM_TK_SYM:
case LM_TK_BIGSYM:
case LM_TK_FUNCLIM:
p = new MathBigopInset(l);
break;
case LM_TK_SYM: {
MathTextCodes code = static_cast<MathTextCodes>(l->id);
if (code < 255)
insert(l->id, l->bin != LMB_NONE ? LM_TC_BOPS : LM_TC_SYMB);
else
p = new MathFuncInset(l->name);
break;
}
case LM_TK_STACK:
p = new MathFracInset("stackrel");

View File

@ -81,9 +81,7 @@ enum MathTextCodes {
LM_TC_BOP,
/// Internal code for symbols
LM_TC_SYMB,
///
LM_TC_BOPS,
///
/// Internal code for symbols that get bigger in displayed math
LM_TC_BSYM,
///
LM_FONT_END,

View File

@ -95,7 +95,7 @@ void MathMacroTable::builtinMacros()
{
MathMacroTemplate * t = new MathMacroTemplate("notin", 0);
MathDecorationInset * p = new MathDecorationInset("not", LM_not);
p->cell(0).push_back(LM_in, LM_TC_BOPS);
p->cell(0).push_back(LM_in, LM_TC_SYMB);
t->push_back(p);
insertTemplate(t);
}

View File

@ -631,18 +631,11 @@ void mathed_parse(MathArray & array, unsigned flags)
break;
case LM_TK_BIGSYM:
case LM_TK_SYM:
case LM_TK_FUNCLIM:
limits = 0;
array.push_back(new MathBigopInset(yylval.l));
break;
case LM_TK_SYM:
if (yylval.l->id < 256) {
MathTextCodes tc = yylval.l->bin == LMB_NONE ? LM_TC_SYMB : LM_TC_BOPS;
array.push_back(yylval.l->id, tc);
} else
array.push_back(new MathFuncInset(yylval.l->name));
break;
case LM_TK_BOP:
array.push_back(yylval.i, LM_TC_BOP);

View File

@ -30,13 +30,13 @@ bool MathIsAlphaFont(MathTextCodes x)
bool MathIsBinary(MathTextCodes x)
{
return x == LM_TC_BOP || x == LM_TC_BOPS;
return x == LM_TC_BOP;
}
bool MathIsSymbol(MathTextCodes x)
{
return x == LM_TC_SYMB || x == LM_TC_BOPS || x == LM_TC_BSYM;
return x == LM_TC_SYMB || x == LM_TC_BSYM;
}
@ -159,9 +159,6 @@ LyXFont WhichFont(MathTextCodes type, MathStyles size)
switch (type) {
case LM_TC_SYMB:
f = Math_Fonts[2];
break;
case LM_TC_BSYM:
f = Math_Fonts[2];
break;