From: André Pönitz Date: Thu, 26 Jul 2001 13:52:47 +0000 (+0000) Subject: small cleanups X-Git-Tag: 1.6.10~20986 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d812b509d0378ef4feec2a81eeaadfef4822d75c;p=features.git small cleanups git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2359 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_bigopinset.C b/src/mathed/math_bigopinset.C index cda49613db..a6dbc948c6 100644 --- a/src/mathed/math_bigopinset.C +++ b/src/mathed/math_bigopinset.C @@ -32,10 +32,10 @@ void MathBigopInset::writeNormal(ostream & os) const 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; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 73095ef42f..d8ec314f5c 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -602,7 +602,10 @@ void MathCursor::interpret(string const & s) //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(); @@ -659,10 +662,11 @@ void MathCursor::interpret(string const & s) 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; @@ -691,10 +695,6 @@ void MathCursor::interpret(string const & s) 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; diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 356ec41193..3d048b0162 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -117,8 +117,6 @@ enum MathInsetTypes { /// A LaTeX macro LM_OT_UNDEF, /// - LM_OT_FUNC, - /// LM_OT_FUNCLIM, /// LM_OT_MACRO, diff --git a/src/mathed/math_funcinset.C b/src/mathed/math_funcinset.C index e0ce29cddf..0f72e29887 100644 --- a/src/mathed/math_funcinset.C +++ b/src/mathed/math_funcinset.C @@ -14,11 +14,9 @@ using std::ostream; 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 diff --git a/src/mathed/math_funcinset.h b/src/mathed/math_funcinset.h index e054574781..781d40ccc0 100644 --- a/src/mathed/math_funcinset.h +++ b/src/mathed/math_funcinset.h @@ -15,7 +15,7 @@ class MathFuncInset : public MathInset { public: /// - explicit MathFuncInset(string const & nm, MathInsetTypes ot = LM_OT_FUNC); + explicit MathFuncInset(string const & nm); /// virtual MathInset * clone() const; /// @@ -26,8 +26,5 @@ public: void writeNormal(std::ostream &) const; /// void metrics(MathStyles st); -private: - /// - bool lims_; }; #endif diff --git a/src/mathed/math_hash.C b/src/mathed/math_hash.C index 2ae68b1e6d..6c2c4c4365 100644 --- a/src/mathed/math_hash.C +++ b/src/mathed/math_hash.C @@ -200,7 +200,7 @@ latexkeys const wordlist[] = {"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}, diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index be27ce54a5..a9839b8dd2 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -631,9 +631,8 @@ void mathed_parse(MathArray & array, unsigned flags) 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; @@ -746,15 +745,10 @@ void mathed_parse(MathArray & array, unsigned flags) 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); @@ -763,7 +757,7 @@ void mathed_parse(MathArray & array, unsigned flags) 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: diff --git a/src/mathed/math_parser.h b/src/mathed/math_parser.h index 64629e5e05..02e16a8854 100644 --- a/src/mathed/math_parser.h +++ b/src/mathed/math_parser.h @@ -84,10 +84,6 @@ enum MathTokenEnum /// LM_TK_STY, /// - LM_TK_PMOD, - /// - LM_TK_BMOD, - /// LM_TK_MACRO, /// LM_TK_SPECIAL,