void MathBigopInset::metrics(MathStyles st)
{
- //cerr << "\nBigopDraw\n";
+ //cerr << "\nBigopDraw: " << name_ << ": " << sym_ << "\n";
size(st);
- if (sym_ < 256 || sym_ == LM_oint) {
+ if (sym_ && (sym_ < 256 || sym_ == LM_oint)) {
ssym_ = string();
ssym_ += (sym_ == LM_oint) ? LM_int : sym_;
code_ = LM_TC_BSYM;
//lyxerr << "interpret: '" << s << "'\n";
//lyxerr << "in: " << in_word_set(s) << " \n";
- if (s.size() && (s[0] == '^' || s[0] == '_')) {
+ if (s.empty())
+ return;
+
+ if (s[0] == '^' || s[0] == '_') {
bool const up = (s[0] == '^');
selCut();
MathScriptInset * p = prevScriptInset();
p = pp;
}
else
- p = new MathFuncInset(s, LM_OT_UNDEF);
+ p = new MathFuncInset(s);
} else {
switch (l->token) {
case LM_TK_BIGSYM:
+ case LM_TK_FUNCLIM:
p = new MathBigopInset(s, l->id);
break;
p = new MathDecorationInset(l->name, l->id);
break;
- case LM_TK_FUNCLIM:
- p = new MathFuncInset(l->name, LM_OT_FUNCLIM);
- break;
-
case LM_TK_SPACE:
p = new MathSpaceInset(l->id);
break;
/// A LaTeX macro
LM_OT_UNDEF,
///
- LM_OT_FUNC,
- ///
LM_OT_FUNCLIM,
///
LM_OT_MACRO,
extern LyXFont WhichFont(short type, int size);
-MathFuncInset::MathFuncInset(string const & nm, MathInsetTypes ot)
- : MathInset(0, nm, ot)
-{
- lims_ = (getType() == LM_OT_FUNCLIM);
-}
+MathFuncInset::MathFuncInset(string const & nm)
+ : MathInset(0, nm)
+{}
MathInset * MathFuncInset::clone() const
class MathFuncInset : public MathInset {
public:
///
- explicit MathFuncInset(string const & nm, MathInsetTypes ot = LM_OT_FUNC);
+ explicit MathFuncInset(string const & nm);
///
virtual MathInset * clone() const;
///
void writeNormal(std::ostream &) const;
///
void metrics(MathStyles st);
-private:
- ///
- bool lims_;
};
#endif
{"phi", LM_TK_SYM, LM_phi, LMB_NONE},
{"pi", LM_TK_SYM, LM_pi, LMB_NONE},
{"pm", LM_TK_SYM, LM_pm, LMB_OPERATOR},
- {"pmod", LM_TK_PMOD, 0, LMB_NONE},
+ //{"pmod", LM_TK_SYM, 0, LMB_NONE},
{"prec", LM_TK_SYM, LM_prec, LMB_RELATION},
{"preceq", LM_TK_SYM, LM_preceq, LMB_RELATION},
{"prime", LM_TK_SYM, LM_prime, LMB_NONE},
break;
case LM_TK_BIGSYM:
- //lyxerr << "clearing limits " << limits << "\n";
+ case LM_TK_FUNCLIM:
limits = 0;
- //lyxerr << "found bigop '" << yylval.l->name << "'\n";
array.push_back(new MathBigopInset(yylval.l->name, yylval.l->id));
break;
curr_num = false;
break;
- case LM_TK_PMOD:
case LM_TK_FUNC:
array.push_back(new MathFuncInset(yylval.l->name));
break;
- case LM_TK_FUNCLIM:
- array.push_back(new MathFuncInset(yylval.l->name, LM_OT_FUNCLIM));
- break;
-
case LM_TK_UNDEF:
if (MathMacroTable::hasTemplate(yytext)) {
MathMacro * m = MathMacroTable::cloneTemplate(yytext);
array.push_back(m);
m->metrics(LM_ST_TEXT);
} else
- array.push_back(new MathFuncInset(yytext, LM_OT_UNDEF));
+ array.push_back(new MathFuncInset(yytext));
break;
case LM_TK_END:
///
LM_TK_STY,
///
- LM_TK_PMOD,
- ///
- LM_TK_BMOD,
- ///
LM_TK_MACRO,
///
LM_TK_SPECIAL,